From a0b3494c42c5d2148d5a9afd24ff458348ce014a Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sun, 3 Mar 2019 21:27:34 +0100 Subject: [PATCH] Fix crash when sharing to Tusky while not logged in (#1096) --- app/src/main/java/com/keylesspalace/tusky/MainActivity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java index 0c8f3dec2..2c581c260 100644 --- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java @@ -119,6 +119,11 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + if(accountManager.getActiveAccount() == null) { + // will be redirected to LoginActivity by BaseActivity + return; + } + Intent intent = getIntent(); boolean showNotificationTab = false;