fix Spot Bugs warning

Possible null pointer dereference in com.nextcloud.talk.utils.PushUtils.updatePushStateForUser(Map, User) due to return value of called method

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-12-14 17:57:14 +01:00 committed by Andy Scherzinger
parent da8148a134
commit eff4b912bd
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B

View File

@ -338,6 +338,7 @@ public class PushUtils {
pushConfigurationState.setUserPublicKey(proxyMap.get("userPublicKey")); pushConfigurationState.setUserPublicKey(proxyMap.get("userPublicKey"));
pushConfigurationState.setUsesRegularPass(Boolean.FALSE); pushConfigurationState.setUsesRegularPass(Boolean.FALSE);
if (user.getId() != null) {
userManager.updatePushState(user.getId(), pushConfigurationState).subscribe(new SingleObserver<Integer>() { userManager.updatePushState(user.getId(), pushConfigurationState).subscribe(new SingleObserver<Integer>() {
@Override @Override
public void onSubscribe(Disposable d) { public void onSubscribe(Disposable d) {
@ -358,6 +359,10 @@ public class PushUtils {
false)); false));
} }
}); });
} else {
Log.e(TAG, "failed to update updatePushStateForUser. user.getId() was null");
}
} }
private Key readKeyFromString(boolean readPublicKey, String keyString) { private Key readKeyFromString(boolean readPublicKey, String keyString) {