From 0d8c2f263ffef63675ba3f2f66ca04cbdaed7982 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 9 Jun 2022 17:23:55 +0200 Subject: [PATCH] Fix #155 - Avoid a crash when replying and account is null --- .../java/app/fedilab/android/activities/ComposeActivity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java index 28aabd40..487d43de 100644 --- a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java @@ -189,6 +189,11 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana if (account == null) { account = BaseMainActivity.accountWeakReference.get(); } + if (account == null) { + Toasty.error(ComposeActivity.this, getString(R.string.toast_error), Toasty.LENGTH_SHORT).show(); + finish(); + return; + } if (instance == null) { instance = account.instance; }