fix some crashes

This commit is contained in:
Thomas 2022-09-20 09:51:53 +02:00
parent 1cb52f167f
commit dcb41be114
2 changed files with 2 additions and 2 deletions

View File

@ -453,7 +453,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
public static String getVisibility(String defaultVisibility) {
int tootVisibility = visibilityToNumber(defaultVisibility);
if (currentAccount != null && currentAccount.mastodon_account.source != null) {
if (currentAccount != null && currentAccount.mastodon_account != null && currentAccount.mastodon_account.source != null) {
int userVisibility = visibilityToNumber(currentAccount.mastodon_account.source.privacy);
if (tootVisibility > userVisibility) {
return visibilityToString(userVisibility);

View File

@ -482,7 +482,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
if (attachmentList != null && attachmentList.size() > 0) {
holder.binding.sensitiveMedia.setVisibility(View.VISIBLE);
if (!statusList.get(position).sensitive) {
if (currentAccount.mastodon_account.source != null) {
if (currentAccount != null && currentAccount.mastodon_account != null && currentAccount.mastodon_account.source != null) {
holder.binding.sensitiveMedia.setChecked(currentAccount.mastodon_account.source.sensitive);
statusList.get(position).sensitive = currentAccount.mastodon_account.source.sensitive;
} else {