Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Commit

Permalink
drawer: make getTopThreadController return null if not found.
Browse files Browse the repository at this point in the history
Fixes a common crash that I can't trace back right now.
  • Loading branch information
floens committed Apr 29, 2018
1 parent 73562d6 commit 542d2ef
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ public void onPinClicked(Pin pin) {
drawerLayout.post(() -> drawerLayout.post(() -> drawerLayout.closeDrawer(drawer)));

ThreadController threadController = getTopThreadController();
threadController.openPin(pin);
if (threadController != null) {
threadController.openPin(pin);
}
}

@Override
Expand Down Expand Up @@ -300,7 +302,8 @@ private ThreadController getTopThreadController() {
return (ThreadController) slideNav.leftController;
}
}
throw new IllegalStateException();

return null;
}

private ToolbarNavigationController getMainToolbarNavigationController() {
Expand Down

0 comments on commit 542d2ef

Please sign in to comment.