mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 07:06:47 +00:00
Fix capabilities NPE
This commit is contained in:
1 parent
c623f70caa
commit
44d38a00d4
2 files changed
+6
-2
No files matched your search
@@ -133,7 +133,9 @@ public class Account implements Principal {
|
||||
}
|
||||
|
||||
public boolean isUuidAddressingSupported() {
|
||||
return devices.stream().filter(Device::isEnabled).allMatch(device -> device.getCapabilities().isUuid());
|
||||
return devices.stream()
|
||||
.filter(Device::isEnabled)
|
||||
.allMatch(device -> device.getCapabilities() != null && device.getCapabilities().isUuid());
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
|
||||
@@ -23,6 +23,8 @@ import org.whispersystems.textsecuregcm.entities.UserCapabilities;
|
||||
import org.whispersystems.textsecuregcm.entities.SignedPreKey;
|
||||
import org.whispersystems.textsecuregcm.util.Util;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.validation.constraints.Null;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class Device {
|
||||
@@ -188,7 +190,7 @@ public class Device {
|
||||
return new AuthenticationCredentials(authToken, salt);
|
||||
}
|
||||
|
||||
public DeviceCapabilities getCapabilities() {
|
||||
public @Nullable DeviceCapabilities getCapabilities() {
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user