diff --git a/src/osg/GraphicsCostEstimator.cpp b/src/osg/GraphicsCostEstimator.cpp index f835cb57c..36fec361e 100644 --- a/src/osg/GraphicsCostEstimator.cpp +++ b/src/osg/GraphicsCostEstimator.cpp @@ -233,9 +233,12 @@ public: for(unsigned int i=0; igetNumTextureAttributeLists(); ++i) { const osg::Texture* texture = dynamic_cast(stateset->getTextureAttribute(i, osg::StateAttribute::TEXTURE)); - CostPair cost = _gce->estimateCompileCost(texture); - _costs.first += cost.first; - _costs.second += cost.second; + if (texture) + { + CostPair cost = _gce->estimateCompileCost(texture); + _costs.first += cost.first; + _costs.second += cost.second; + } } }