fixed NPE

This commit is contained in:
Mariotaku Lee 2016-07-07 00:07:20 +08:00
parent 448393a217
commit 0515fd6cf9
2 changed files with 12 additions and 12 deletions

View File

@ -91,7 +91,7 @@ public abstract class AbsFriendshipOperationTask extends AbstractTask<AbsFriends
succeededWorker(twitter, credentials, args, parcelableUser);
return SingleResponse.Companion.getInstance(parcelableUser);
} catch (final MicroBlogException e) {
return SingleResponse.Companion.getInstance(null, e);
return SingleResponse.Companion.getInstance(e);
}
}

View File

@ -652,9 +652,9 @@ public class AsyncTwitterWrapper extends TwitterWrapper {
}
final UserList result = twitter.addUserListMembers(mListId, UserKey.getIds(userIds));
final ParcelableUserList list = ParcelableUserListUtils.from(result, mAccountKey);
return SingleResponse.Companion.getInstance(list, null);
return SingleResponse.Companion.getInstance(list);
} catch (final MicroBlogException e) {
return SingleResponse.Companion.getInstance(null, e);
return SingleResponse.Companion.getInstance(e);
}
}
@ -997,9 +997,9 @@ public class AsyncTwitterWrapper extends TwitterWrapper {
userListUpdate.setMode(mIsPublic ? UserList.Mode.PUBLIC : UserList.Mode.PRIVATE);
userListUpdate.setDescription(mDescription);
final UserList list = twitter.createUserList(userListUpdate);
return SingleResponse.Companion.getInstance(ParcelableUserListUtils.from(list, mAccountKey), null);
return SingleResponse.Companion.getInstance(ParcelableUserListUtils.from(list, mAccountKey));
} catch (final MicroBlogException e) {
return SingleResponse.Companion.getInstance(null, e);
return SingleResponse.Companion.getInstance(e);
}
}
@ -1043,9 +1043,9 @@ public class AsyncTwitterWrapper extends TwitterWrapper {
}
final UserList userList = twitter.deleteUserListMembers(mUserListId, UserKey.getIds(userIds));
final ParcelableUserList list = ParcelableUserListUtils.from(userList, mAccountKey);
return SingleResponse.Companion.getInstance(list, null);
return SingleResponse.Companion.getInstance(list);
} catch (final MicroBlogException e) {
return SingleResponse.Companion.getInstance(null, e);
return SingleResponse.Companion.getInstance(e);
}
}
@ -1111,12 +1111,12 @@ public class AsyncTwitterWrapper extends TwitterWrapper {
try {
final DirectMessage message = twitter.destroyDirectMessage(mMessageId);
deleteMessages();
return SingleResponse.Companion.getInstance(message, null);
return SingleResponse.Companion.getInstance(message);
} catch (final MicroBlogException e) {
if (isMessageNotFound(e)) {
deleteMessages();
}
return SingleResponse.Companion.getInstance(null, e);
return SingleResponse.Companion.getInstance(e);
}
}
@ -1372,7 +1372,7 @@ public class AsyncTwitterWrapper extends TwitterWrapper {
DataStoreUtils.deleteStatus(mResolver, mAccountKey, mStatusId, status);
DataStoreUtils.deleteActivityStatus(mResolver, mAccountKey, mStatusId, status);
}
return SingleResponse.Companion.getInstance(status, exception);
return SingleResponse.Companion.getInstance(status);
}
@Override
@ -1423,9 +1423,9 @@ public class AsyncTwitterWrapper extends TwitterWrapper {
try {
final UserList userList = twitter.destroyUserListSubscription(mListId);
final ParcelableUserList list = ParcelableUserListUtils.from(userList, mAccountKey);
return SingleResponse.Companion.getInstance(list, null);
return SingleResponse.Companion.getInstance(list);
} catch (final MicroBlogException e) {
return SingleResponse.Companion.getInstance(null, e);
return SingleResponse.Companion.getInstance(e);
}
}