From 77b8b278ea242f0f606c467201e1cd81f751e9e9 Mon Sep 17 00:00:00 2001 From: Frederic Bouvier Date: Sat, 14 Apr 2012 18:00:42 +0200 Subject: [PATCH] Ensure uniform are there before trying to use them --- simgear/scene/model/SGLightAnimation.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/simgear/scene/model/SGLightAnimation.cxx b/simgear/scene/model/SGLightAnimation.cxx index 930d2db2..e2f25d96 100644 --- a/simgear/scene/model/SGLightAnimation.cxx +++ b/simgear/scene/model/SGLightAnimation.cxx @@ -72,11 +72,14 @@ public: BOOST_FOREACH(osg::ref_ptr& pass, technique->passes) { osg::Uniform* amb = pass->getUniform("Ambient"); - amb->set(toOsg(_ambient) * dim); + if (amb) + amb->set(toOsg(_ambient) * dim); osg::Uniform* dif = pass->getUniform("Diffuse"); - dif->set(toOsg(_diffuse) * dim); + if (dif) + dif->set(toOsg(_diffuse) * dim); osg::Uniform* spe = pass->getUniform("Specular"); - spe->set(toOsg(_specular) * dim); + if (spe) + spe->set(toOsg(_specular) * dim); } } } -- 2.39.5