diff --git a/simgear/canvas/elements/CanvasElement.cxx b/simgear/canvas/elements/CanvasElement.cxx index 934767cf..7b8a8c6b 100644 --- a/simgear/canvas/elements/CanvasElement.cxx +++ b/simgear/canvas/elements/CanvasElement.cxx @@ -250,7 +250,17 @@ namespace canvas { if( parent == _node && child->getNameString() == NAME_TRANSFORM ) { - assert(child->getIndex() < static_cast(_transform_types.size())); + if( child->getIndex() >= static_cast(_transform_types.size()) ) + { + SG_LOG + ( + SG_GENERAL, + SG_WARN, + "Element::childRemoved: unknown transform: " << child->getPath() + ); + return; + } + _transform_types[ child->getIndex() ] = TT_NONE; while( !_transform_types.empty() && _transform_types.back() == TT_NONE )