Skip to content

Commit 77cb6cd

Browse files
youle31panzergame
authored andcommitted
UPBGE: Fix crash when calling setTexture in KX_2DFilter.
I just added a check in setTexture to see if there is an error and return because it caused a crash when looking for uniform location whitout a shader.
1 parent eff8b31 commit 77cb6cd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

source/gameengine/Ketsji/KX_2DFilter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ KX_PYMETHODDEF_DOC(KX_2DFilter, setTexture, "setTexture(index, bindCode, sampler
9090
}
9191

9292
if (samplerName) {
93+
if (GetError()) {
94+
Py_RETURN_NONE;
95+
}
9396
int loc = GetUniformLocation(samplerName);
9497

9598
if (loc != -1) {

0 commit comments

Comments
 (0)