[client] egl: add checking to egl_shader_get_uniform_location

This commit is contained in:
Geoffrey McRae 2018-12-12 16:32:16 +11:00
parent 43d08df6b3
commit 73da86ac0e

View File

@ -215,5 +215,11 @@ void egl_shader_associate_textures(EGL_Shader * this, const int count)
GLint egl_shader_get_uniform_location(EGL_Shader * this, const char * name) GLint egl_shader_get_uniform_location(EGL_Shader * this, const char * name)
{ {
if (!this->shader)
{
DEBUG_ERROR("Shader program has not been compiled");
return 0;
}
return glGetUniformLocation(this->shader, name); return glGetUniformLocation(this->shader, name);
} }