Skip to content

Commit

Permalink
Fix edge case NPE when the user hits the back button very rapidly dur…
Browse files Browse the repository at this point in the history
…ing state restoration (#674)
  • Loading branch information
EricKuck authored Jun 14, 2022
1 parent d32fc81 commit 5f04d9d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions conductor/src/main/java/com/bluelinelabs/conductor/Router.java
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ void watchContainerAttach() {
@Override
public void run() {
containerFullyAttached = true;
performPendingControllerChanges();
}
});
}
Expand Down Expand Up @@ -861,12 +862,14 @@ private void performControllerChange(@Nullable final Controller to, @Nullable fi
to.setNeedsAttach(true);
}
pendingControllerChanges.add(transaction);
container.post(new Runnable() {
@Override
public void run() {
performPendingControllerChanges();
}
});
if (container != null) {
container.post(new Runnable() {
@Override
public void run() {
performPendingControllerChanges();
}
});
}
} else {
ControllerChangeHandler.executeChange(transaction);
}
Expand Down

0 comments on commit 5f04d9d

Please sign in to comment.