From 8a21cd4daa8cb705a42030bf8b7ac2f340a154c7 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 8 Oct 2016 12:47:27 +0200 Subject: [PATCH] fix crash in DocumentIndex::cloneViewProvider --- src/Gui/DocumentModel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)); }