mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 08:40:16 +01:00
Fix capabilities NPE
This commit is contained in:
@@ -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