From 29eeb6c2d85829edfc2c415075923d329407116a Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 26 Nov 2018 13:09:11 +0100 Subject: [PATCH] fix crash if origin feature doesn't exist when trying to create dependency graph --- src/App/Document.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 67d9490c5f..f91f464058 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -537,6 +537,10 @@ void Document::exportGraphviz(std::ostream& out) const //setup the origin if available if(cs->hasExtension(App::OriginGroupExtension::getExtensionClassTypeId())) { auto origin = cs->getExtensionByType()->Origin.getValue(); + if (!origin) { + std::cerr << "Origin feature not found" << std::endl; + return; + } auto& osub = sub.create_subgraph(); GraphList[origin] = &osub; get_property(osub, graph_name) = getClusterName(origin);