Skip to content

Commit

Permalink
Fix NPE with presenter.onErasedOnce() due to delayed call to onEras…
Browse files Browse the repository at this point in the history
…e when user long press on erase button and rotate screen.
  • Loading branch information
devnied committed Jul 19, 2020
1 parent 9eeb457 commit 93514fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/src/main/java/com/maltaisn/calcdialog/CalcDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ public Dialog onCreateDialog(final Bundle state) {
eraseBtn.setOnEraseListener(new CalcEraseButton.EraseListener() {
@Override
public void onErase() {
presenter.onErasedOnce();
if (presenter != null) {
presenter.onErasedOnce();
}
}

@Override
Expand Down

0 comments on commit 93514fb

Please sign in to comment.