Fix "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" SpotBugs complaint

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2021-05-14 14:40:28 +02:00
parent 16ca03cb5c
commit 4790e7b7e4
No known key found for this signature in database
GPG key ID: 7076EA9751AACDDA

View file

@ -74,6 +74,7 @@ public class AddParticipantsToConversation extends Worker {
String credentials = ApiUtils.getCredentials(user.getUsername(), user.getToken());
RetrofitBucket retrofitBucket;
if (selectedUserIds != null) {
for (String userId : selectedUserIds) {
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipant(apiVersion, user.getBaseUrl(),
conversationToken,
@ -83,7 +84,9 @@ public class AddParticipantsToConversation extends Worker {
.subscribeOn(Schedulers.io())
.blockingSubscribe();
}
}
if (selectedGroupIds != null) {
for (String groupId : selectedGroupIds) {
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipantWithSource(
apiVersion,
@ -97,7 +100,9 @@ public class AddParticipantsToConversation extends Worker {
.subscribeOn(Schedulers.io())
.blockingSubscribe();
}
}
if (selectedCircleIds != null) {
for (String circleId : selectedCircleIds) {
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipantWithSource(
apiVersion,
@ -111,7 +116,9 @@ public class AddParticipantsToConversation extends Worker {
.subscribeOn(Schedulers.io())
.blockingSubscribe();
}
}
if (selectedEmails != null) {
for (String email : selectedEmails) {
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipantWithSource(
apiVersion,
@ -125,6 +132,7 @@ public class AddParticipantsToConversation extends Worker {
.subscribeOn(Schedulers.io())
.blockingSubscribe();
}
}
eventBus.post(new EventStatus(user.getId(), EventStatus.EventType.PARTICIPANTS_UPDATE, true));
return Result.success();