Fix NPE when legacy profile has no capabilities

Fixes #616
This commit is contained in:
AsamK 2021-05-12 20:12:05 +02:00
parent 03a5483791
commit ea11f3b1fd

View file

@ -552,14 +552,16 @@ public class SignalAccount implements Closeable {
final var profile = profileEntry.getProfile();
if (profile != null) {
final var capabilities = new HashSet<Profile.Capability>();
if (profile.getCapabilities().gv1Migration) {
capabilities.add(Profile.Capability.gv1Migration);
}
if (profile.getCapabilities().gv2) {
capabilities.add(Profile.Capability.gv2);
}
if (profile.getCapabilities().storage) {
capabilities.add(Profile.Capability.storage);
if (profile.getCapabilities() != null) {
if (profile.getCapabilities().gv1Migration) {
capabilities.add(Profile.Capability.gv1Migration);
}
if (profile.getCapabilities().gv2) {
capabilities.add(Profile.Capability.gv2);
}
if (profile.getCapabilities().storage) {
capabilities.add(Profile.Capability.storage);
}
}
final var newProfile = new Profile(profileEntry.getLastUpdateTimestamp(),
profile.getGivenName(),