diff --git a/src/Canvas/canvas_mgr.cxx b/src/Canvas/canvas_mgr.cxx index 6646b7762..0869d5d3f 100644 --- a/src/Canvas/canvas_mgr.cxx +++ b/src/Canvas/canvas_mgr.cxx @@ -137,6 +137,10 @@ CanvasMgr::getCanvasTexId(const simgear::canvas::CanvasPtr& canvas) const //---------------------------------------------------------------------------- void CanvasMgr::handleModelReinit(SGPropertyNode*) { - for(size_t i = 0; i < _elements.size(); ++i) - static_cast(_elements[i].get())->reloadPlacements("object"); + for (size_t i = 0; i < _elements.size(); ++i) + { + sc::Canvas* element = static_cast(_elements[i].get()); + if (element) + element->reloadPlacements("object"); + } }