From 3456434e37755eb3166fa839bb610538f5fdd46b Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Fri, 18 Sep 2009 15:43:46 +0200 Subject: [PATCH] check for null effect in EffectCullVisitor An EffectGeode might not have any effect. --- simgear/scene/material/EffectCullVisitor.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/simgear/scene/material/EffectCullVisitor.cxx b/simgear/scene/material/EffectCullVisitor.cxx index a1a4fa82..62952a9f 100644 --- a/simgear/scene/material/EffectCullVisitor.cxx +++ b/simgear/scene/material/EffectCullVisitor.cxx @@ -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; } -- 2.39.5