diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/ScreenMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ScreenMixin.java index 053a43dde6..41b7676137 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/ScreenMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/ScreenMixin.java @@ -17,6 +17,7 @@ import net.minecraft.client.gui.screen.ChatScreen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.text.Style; +import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -36,8 +37,8 @@ private void onRenderBackground(CallbackInfo info) { } @Inject(method = "handleTextClick", at = @At(value = "HEAD"), cancellable = true) - private void onInvalidClickEvent(Style style, CallbackInfoReturnable cir) { - if (!(style.getClickEvent() instanceof RunnableClickEvent runnableClickEvent)) return; + private void onInvalidClickEvent(@Nullable Style style, CallbackInfoReturnable cir) { + if (style == null || !(style.getClickEvent() instanceof RunnableClickEvent runnableClickEvent)) return; runnableClickEvent.runnable.run(); cir.setReturnValue(true);