Skip to content

Commit e27c716

Browse files
committed
Don't crash in texParameteri if boundTexture is null
1 parent 5ff1ff1 commit e27c716

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/net/vulkanmod/gl/GlTexture.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ public static void texParameteri(int target, int pName, int param) {
164164
if (target != GL11.GL_TEXTURE_2D)
165165
throw new UnsupportedOperationException("target != GL_TEXTURE_2D not supported");
166166

167+
if (boundTexture == null)
168+
return;
169+
167170
switch (pName) {
168171
case GL30.GL_TEXTURE_MAX_LEVEL -> boundTexture.setMaxLevel(param);
169172
case GL30.GL_TEXTURE_MAX_LOD -> boundTexture.setMaxLod(param);

0 commit comments

Comments
 (0)