Fix capabilities NPE
This commit is contained in:
parent
c623f70caa
commit
44d38a00d4
|
@ -133,7 +133,9 @@ public class Account implements Principal {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUuidAddressingSupported() {
|
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() {
|
public boolean isEnabled() {
|
||||||
|
|
|
@ -23,6 +23,8 @@ import org.whispersystems.textsecuregcm.entities.UserCapabilities;
|
||||||
import org.whispersystems.textsecuregcm.entities.SignedPreKey;
|
import org.whispersystems.textsecuregcm.entities.SignedPreKey;
|
||||||
import org.whispersystems.textsecuregcm.util.Util;
|
import org.whispersystems.textsecuregcm.util.Util;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import javax.validation.constraints.Null;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
public class Device {
|
public class Device {
|
||||||
|
@ -188,7 +190,7 @@ public class Device {
|
||||||
return new AuthenticationCredentials(authToken, salt);
|
return new AuthenticationCredentials(authToken, salt);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeviceCapabilities getCapabilities() {
|
public @Nullable DeviceCapabilities getCapabilities() {
|
||||||
return capabilities;
|
return capabilities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue