From bff5f97fe6106e04a95abc001f30da41514cd5f0 Mon Sep 17 00:00:00 2001 From: dibenedetto Date: Sat, 2 Jun 2012 00:35:04 +0000 Subject: [PATCH] added check for uniform location in glw program. --- wrap/glw/program.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wrap/glw/program.h b/wrap/glw/program.h index ba65c0f7..b829a3b5 100644 --- a/wrap/glw/program.h +++ b/wrap/glw/program.h @@ -243,7 +243,9 @@ class Program : public Object #if GLW_ASSERT_UNIFORM_LOCATION GLW_ASSERT(this->m_uniforms.count(name) > 0); #endif - return this->m_uniforms.find(name)->second.location; + UniformMapConstIterator it = this->m_uniforms.find(name); + if (it == this->m_uniforms.end()) return -1; + return it->second.location; } #define _GLW_IMPLEMENT_SCALAR_UNIFORM_(TYPE, FUNCION_SUFFIX) \