Skip to content

Commit

Permalink
Add NullPointerException to prevent accessing null object
Browse files Browse the repository at this point in the history
  • Loading branch information
MyidShin committed Feb 21, 2024
1 parent 54a4adf commit 41a0d34
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,9 @@ public void showDialog(final int type, final double value,
mDatePrompt.setDateTime(type, value, min, max);

try {
final WSession.PromptDelegate delegate = mSession.getPromptDelegate();
delegate.onDateTimePrompt(mSession, mDatePrompt);
} catch (WindowManager.BadTokenException e) {
mDatePrompt.markComplete();
mDelegate.onDateTimePrompt(mSession, mDatePrompt);
} catch (WindowManager.BadTokenException | NullPointerException e) {
mDatePrompt.dismiss();
}
}

Expand Down

0 comments on commit 41a0d34

Please sign in to comment.