diff --git a/src/Gui/DocumentModel.cpp b/src/Gui/DocumentModel.cpp index 48cc92c8a3..7b3420b146 100644 --- a/src/Gui/DocumentModel.cpp +++ b/src/Gui/DocumentModel.cpp @@ -225,8 +225,11 @@ namespace Gui { it = vp_nodes.find(&vp); if (it != vp_nodes.end()) { boost::unordered_set::const_iterator v; - v = it->second.begin(); - return (*v)->clone(); + if (!it->second.empty()) { + v = it->second.begin(); + if (*v) + return (*v)->clone(); + } } return new ViewProviderIndex(vp, const_cast(this)); }