Skip to content

Commit

Permalink
fix NPE when trying to display null screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Nov 26, 2023
1 parent 4a85ded commit 8df47b5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ public static void displayScreen(GuiScreen screen) {
* @param ticks the amount of ticks to wait for before displaying the screen.
*/
public static void displayScreen(GuiScreen screen, int ticks) {
Optional<GuiScreen> optional = Optional.of(screen);
Optional<GuiScreen> optional = screen == null ? Optional.empty() : Optional.of(screen);
screenQueue.add(optional);
new TickDelay(() -> {
UScreen.displayScreen(screen);
UScreen.displayScreen(optional.orElse(null));
screenQueue.remove(optional);
}, ticks);
}
Expand Down

0 comments on commit 8df47b5

Please sign in to comment.