Added checks against null pointers and removed #if 0 block.
Added checks against null pointers and removed #if 0 block.

openscenegraph/osg,tomasthoresen/osg,scrawl/osg,marchelbling/osg,scrawl/osg,scrawl/osg,scrawl/osg,marchelbling/osg,tomasthoresen/osg,jtorresfabra/osg,jtorresfabra/osg,openscenegraph/osg,openscenegraph/osg,marchelbling/osg,jtorresfabra/osg,jtorresfabra/osg,tomasthoresen/osg,openscenegraph/osg,marchelbling/osg,tomasthoresen/osg