Skip to content

Commit 317417c

Browse files
committed
Fix some random crash.
1 parent e9a3894 commit 317417c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/turing/tmb/client/TMBRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public static void mouseClicked(int mouseX, int mouseY, int width, int height, M
147147
}
148148

149149
public static void keyTyped(char c, int key, int mouseX, int mouseY) {
150-
if (search.isFocused && show) {
150+
if (search != null && search.isFocused && show) {
151151
search.textboxKeyTyped(c, key);
152152
}
153153
}

src/main/java/turing/tmb/mixin/client/ScreenContainerAbstractMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void mouseClicked(int mouseX, int mouseY, int buttonNum, CallbackInfo ci)
4747
@Inject(method = "keyPressed", at = @At("HEAD"), cancellable = true)
4848
public void keyPressed(char eventCharacter, int eventKey, int mx, int my, CallbackInfo ci) {
4949
TMBRenderer.keyTyped(eventCharacter, eventKey, mx, my);
50-
if (TMBRenderer.search.isFocused) {
50+
if (TMBRenderer.search != null && TMBRenderer.search.isFocused) {
5151
ci.cancel();
5252
}
5353
if (TMB.shouldReplaceGuidebook && TMBRenderer.enabledRecipes) {

0 commit comments

Comments
 (0)