From 6ee97e74152a91360ef162d14d3d26b5667e3639 Mon Sep 17 00:00:00 2001 From: SzczurekYT Date: Mon, 4 Dec 2023 17:11:36 +0100 Subject: [PATCH] Fix crash when Blur.prevScreen is null --- src/main/java/com/tterrag/blur/mixin/MixinInGameHud.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/tterrag/blur/mixin/MixinInGameHud.java b/src/main/java/com/tterrag/blur/mixin/MixinInGameHud.java index f8cb6cc..740b908 100644 --- a/src/main/java/com/tterrag/blur/mixin/MixinInGameHud.java +++ b/src/main/java/com/tterrag/blur/mixin/MixinInGameHud.java @@ -19,7 +19,7 @@ public class MixinInGameHud { @Final @Shadow private MinecraftClient client; @Inject(at = @At("TAIL"), method = "render") public void blur$onRender(DrawContext context, float tickDelta, CallbackInfo ci) { - if (client.currentScreen == null && client.world != null && Blur.start > 0 && BlurConfig.blurExclusions.stream().noneMatch(exclusion -> Blur.prevScreen.startsWith(exclusion)) && Blur.screenHasBackground) { + if (client.currentScreen == null && client.world != null && Blur.start > 0 && (Blur.prevScreen == null || BlurConfig.blurExclusions.stream().noneMatch(exclusion -> Blur.prevScreen.startsWith(exclusion))) && Blur.screenHasBackground) { context.fillGradient(0, 0, this.scaledWidth, this.scaledHeight, Blur.getBackgroundColor(false, false), Blur.getBackgroundColor(true, false)); } }