Fix issue #932 - Crash when user is not in a list

This commit is contained in:
Thomas 2023-08-12 09:48:03 +02:00
parent 3d0d68d9f5
commit 11559ac68a
1 changed files with 3 additions and 0 deletions

View File

@ -1017,6 +1017,9 @@ public class ProfileActivity extends BaseActivity {
}
accountsVM.getListContainingAccount(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id)
.observe(ProfileActivity.this, mastodonListUserIs -> {
if (mastodonListUserIs == null) {
mastodonListUserIs = new ArrayList<>();
}
AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(ProfileActivity.this);
builderSingle.setTitle(getString(R.string.action_lists_add_to));
builderSingle.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss());