Skip to content

Commit

Permalink
UPBGE: Fix python representation of BL_Shader when vertProg or fragPr…
Browse files Browse the repository at this point in the history
…og are NULL.
  • Loading branch information
panzergame committed Feb 10, 2016
1 parent fd9e3e3 commit d23d664
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/gameengine/Ketsji/BL_Shader.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ class BL_Shader : public PyObjectPlus
#ifdef WITH_PYTHON
virtual PyObject *py_repr()
{
return PyUnicode_FromFormat("BL_Shader\n\tvertex shader:%s\n\n\tfragment shader%s\n\n", vertProg, fragProg);
if (vertProg && fragProg) {
return PyUnicode_FromFormat("BL_Shader\n\tvertex shader:%s\n\n\tfragment shader%s\n\n", vertProg, fragProg);
}
return PyUnicode_FromString("BL_Shader");
}

// -----------------------------------
Expand Down

0 comments on commit d23d664

Please sign in to comment.