Skip to content

Commit

Permalink
fix: fix NPE
Browse files Browse the repository at this point in the history
Turn on the HandRestock function of Tweakeroo, dig a block in survival mode, such as dirt, and then put it down immediately, it will cause a crash.
  • Loading branch information
shitlime authored Feb 27, 2024
1 parent 6223070 commit ff3bfa2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions xplat/src/main/java/dev/emi/emi/screen/EmiScreenManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -863,9 +863,14 @@ public static void addWidgets(Screen screen) {
search.y = screen.height - 21;
search.setWidth(160);
} else {
search.x = panels.get(1).space.tx;
SidebarPanel panel = panels.get(1);
if (panel.space == null) {
EmiLog.warn("panel.space is null, stop addWidgets.");
return;
}
search.x = panel.space.tx;
search.y = screen.height - 21;
search.setWidth(panels.get(1).space.tw * ENTRY_SIZE);
search.setWidth(panel.space.tw * ENTRY_SIZE);
}
EmiPort.focus(search, false);

Expand Down

0 comments on commit ff3bfa2

Please sign in to comment.