Skip to content

Commit

Permalink
Merge pull request #84 from SzczurekYT/null-fix
Browse files Browse the repository at this point in the history
Fix crash when Blur.prevScreen is null
  • Loading branch information
Motschen authored Dec 19, 2023
2 parents 210759c + 6ee97e7 commit c5f81c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/tterrag/blur/mixin/MixinInGameHud.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down

0 comments on commit c5f81c7

Please sign in to comment.