mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-23 13:35:33 +03:00
Fix "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" SpotBugs complaint
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
16ca03cb5c
commit
4790e7b7e4
1 changed files with 48 additions and 40 deletions
|
@ -74,56 +74,64 @@ public class AddParticipantsToConversation extends Worker {
|
|||
String credentials = ApiUtils.getCredentials(user.getUsername(), user.getToken());
|
||||
|
||||
RetrofitBucket retrofitBucket;
|
||||
for (String userId : selectedUserIds) {
|
||||
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipant(apiVersion, user.getBaseUrl(),
|
||||
conversationToken,
|
||||
userId);
|
||||
if (selectedUserIds != null) {
|
||||
for (String userId : selectedUserIds) {
|
||||
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipant(apiVersion, user.getBaseUrl(),
|
||||
conversationToken,
|
||||
userId);
|
||||
|
||||
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.blockingSubscribe();
|
||||
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.blockingSubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
for (String groupId : selectedGroupIds) {
|
||||
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipantWithSource(
|
||||
apiVersion,
|
||||
user.getBaseUrl(),
|
||||
conversationToken,
|
||||
"groups",
|
||||
groupId
|
||||
);
|
||||
if (selectedGroupIds != null) {
|
||||
for (String groupId : selectedGroupIds) {
|
||||
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipantWithSource(
|
||||
apiVersion,
|
||||
user.getBaseUrl(),
|
||||
conversationToken,
|
||||
"groups",
|
||||
groupId
|
||||
);
|
||||
|
||||
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.blockingSubscribe();
|
||||
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.blockingSubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
for (String circleId : selectedCircleIds) {
|
||||
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipantWithSource(
|
||||
apiVersion,
|
||||
user.getBaseUrl(),
|
||||
conversationToken,
|
||||
"circles",
|
||||
circleId
|
||||
);
|
||||
if (selectedCircleIds != null) {
|
||||
for (String circleId : selectedCircleIds) {
|
||||
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipantWithSource(
|
||||
apiVersion,
|
||||
user.getBaseUrl(),
|
||||
conversationToken,
|
||||
"circles",
|
||||
circleId
|
||||
);
|
||||
|
||||
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.blockingSubscribe();
|
||||
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.blockingSubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
for (String email : selectedEmails) {
|
||||
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipantWithSource(
|
||||
apiVersion,
|
||||
user.getBaseUrl(),
|
||||
conversationToken,
|
||||
"emails",
|
||||
email
|
||||
);
|
||||
if (selectedEmails != null) {
|
||||
for (String email : selectedEmails) {
|
||||
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipantWithSource(
|
||||
apiVersion,
|
||||
user.getBaseUrl(),
|
||||
conversationToken,
|
||||
"emails",
|
||||
email
|
||||
);
|
||||
|
||||
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.blockingSubscribe();
|
||||
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.blockingSubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
eventBus.post(new EventStatus(user.getId(), EventStatus.EventType.PARTICIPANTS_UPDATE, true));
|
||||
|
|
Loading…
Reference in a new issue