Skip to content

Commit

Permalink
[fix] Null pointer when activity finish
Browse files Browse the repository at this point in the history
  • Loading branch information
rh-id committed Jan 30, 2024
1 parent bacc468 commit 451b543
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion navigator/src/main/java/m/co/rh/id/anavigator/Navigator.java
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,14 @@ protected void initViewAnimator() {
private void checkAndConfigureRequestOrientation() {
Activity activity = getActivity();
int activityOrientation = activity.getRequestedOrientation();
StatefulView currentRoute = mNavRouteStack.peek().getStatefulView();
NavRoute navRoute = mNavRouteStack.peek();
if (navRoute == null) {
if (activityOrientation != mActivityDefaultScreenOrientation) {
activity.setRequestedOrientation(mActivityDefaultScreenOrientation);
}
return;
}
StatefulView currentRoute = navRoute.getStatefulView();
if (currentRoute instanceof NavActivity.RequestOrientation) {
int routeOrientation = ((NavActivity.RequestOrientation) currentRoute).getRequestedOrientation();
if (activityOrientation != routeOrientation) {
Expand Down

0 comments on commit 451b543

Please sign in to comment.