diff --git a/simgear/scene/model/SGMaterialAnimation.cxx b/simgear/scene/model/SGMaterialAnimation.cxx index 0169f574..9f7bb733 100644 --- a/simgear/scene/model/SGMaterialAnimation.cxx +++ b/simgear/scene/model/SGMaterialAnimation.cxx @@ -450,7 +450,8 @@ SGMaterialAnimation::createAnimationGroup(osg::Group& parent) stateSet->setTextureAttribute(0, texture2D, osg::StateAttribute::OVERRIDE); stateSet->setTextureMode(0, GL_TEXTURE_2D, osg::StateAttribute::ON); - if (texture2D->getImage()->isImageTranslucent()) { + osg::ref_ptr textureImage = texture2D->getImage(); + if (textureImage && textureImage->isImageTranslucent()) { stateSet->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); stateSet->setMode(GL_BLEND, osg::StateAttribute::ON); }