simgear::EffectGeode* eg = dynamic_cast<simgear::EffectGeode*>(&node);
if( !eg )
return;
-
- osg::StateSet* ss = eg->getEffect()->getDefaultStateSet();
+ simgear::Effect* eff = eg->getEffect();
+ if (!eff)
+ return;
+ osg::StateSet* ss = eff->getDefaultStateSet();
if( !ss )
return;
naRef locals;
naRef modname = naNewString(ctx);
naStr_fromdata(modname, (char*)moduleName, strlen(moduleName));
- if(!naHash_get(_globals, modname, &locals))
+ if (!((_globals).ref).ptr.obj)
+ return false;
+ if (!naHash_get(_globals, modname, &locals))
locals = naNewHash(ctx);
_cmdArg = (SGPropertyNode*)cmdarg;