aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWyvest <wyvestbusiness@gmail.com>2023-01-31 03:23:39 -0500
committerGitHub <noreply@github.com>2023-01-31 19:23:39 +1100
commit0ad9c8991a080667c81819ad6122a131ff0ad400 (patch)
tree52c1c7334150b4a40ea46e4284653a0a8dd30c2a
parentf1a5ba28e92da4f46b39da27277b1c8b7a6ec4bb (diff)
downloadNotEnoughUpdates-0ad9c8991a080667c81819ad6122a131ff0ad400.tar.gz
NotEnoughUpdates-0ad9c8991a080667c81819ad6122a131ff0ad400.tar.bz2
NotEnoughUpdates-0ad9c8991a080667c81819ad6122a131ff0ad400.zip
Fix NPE when resetting blur shader (#574)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java10
1 files changed, 8 insertions, 2 deletions
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<Float, OutputStuff> 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();
+ }
}
}