From 0ad9c8991a080667c81819ad6122a131ff0ad400 Mon Sep 17 00:00:00 2001 From: Wyvest Date: Tue, 31 Jan 2023 03:23:39 -0500 Subject: Fix NPE when resetting blur shader (#574) --- .../github/moulberry/notenoughupdates/core/BackgroundBlur.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java b/src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java index fc2be97b..eaa733e4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java @@ -120,8 +120,14 @@ public class BackgroundBlur { for (Map.Entry entry : blurOutput.entrySet()) { if (remove.contains(entry.getKey())) { entry.getValue().framebuffer.deleteFramebuffer(); - entry.getValue().blurShaderHorz.deleteShader(); - entry.getValue().blurShaderVert.deleteShader(); + Shader blurShaderHorz = entry.getValue().blurShaderHorz; + if (blurShaderHorz != null) { + blurShaderHorz.deleteShader(); + } + Shader blurShaderVert = entry.getValue().blurShaderVert; + if (blurShaderVert != null) { + blurShaderVert.deleteShader(); + } } } -- cgit