Skip to content

Commit 6ee97e7

Browse files
committed
Fix crash when Blur.prevScreen is null
1 parent f9a54f9 commit 6ee97e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/main/java/com/tterrag/blur/mixin/MixinInGameHud.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class MixinInGameHud {
1919
@Final @Shadow private MinecraftClient client;
2020
@Inject(at = @At("TAIL"), method = "render")
2121
public void blur$onRender(DrawContext context, float tickDelta, CallbackInfo ci) {
22-
if (client.currentScreen == null && client.world != null && Blur.start > 0 && BlurConfig.blurExclusions.stream().noneMatch(exclusion -> Blur.prevScreen.startsWith(exclusion)) && Blur.screenHasBackground) {
22+
if (client.currentScreen == null && client.world != null && Blur.start > 0 && (Blur.prevScreen == null || BlurConfig.blurExclusions.stream().noneMatch(exclusion -> Blur.prevScreen.startsWith(exclusion))) && Blur.screenHasBackground) {
2323
context.fillGradient(0, 0, this.scaledWidth, this.scaledHeight, Blur.getBackgroundColor(false, false), Blur.getBackgroundColor(true, false));
2424
}
2525
}

0 commit comments

Comments
 (0)