]> git.mxchange.org Git - simgear.git/commitdiff
check for null effect in EffectCullVisitor
authorTim Moore <timoore@redhat.com>
Fri, 18 Sep 2009 13:43:46 +0000 (15:43 +0200)
committerTim Moore <timoore@redhat.com>
Fri, 18 Sep 2009 13:43:46 +0000 (15:43 +0200)
An EffectGeode might not have any effect.

simgear/scene/material/EffectCullVisitor.cxx

index a1a4fa821393f6720ebc7a2620a6c4cd066ea262..62952a9fe8b56944d6b37ae5cc4bdcbfdf7299ec 100644 (file)
@@ -54,8 +54,9 @@ void EffectCullVisitor::apply(osg::Geode& node)
         CullVisitor::apply(node);
         return;
     }
-    Technique* technique = eg->getEffect()->chooseTechnique(&getRenderInfo());
-    if (!technique) {
+    Effect* effect = eg->getEffect();
+    Technique* technique = 0;
+    if (!(effect && (technique = effect->chooseTechnique(&getRenderInfo())))) {
         CullVisitor::apply(node);
         return;
     }