From e73a16e7b45e19a55ec3017b099080cb0ae94fa2 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 2 Jun 2017 11:13:03 +0200 Subject: [PATCH] when drawing constraint icon handle the case when view provider of sketch is not in sync with geometry --- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 0261f93984..9d1a1a8af3 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -2796,6 +2796,12 @@ void ViewProviderSketch::drawConstraintIcons() break; } + // Double-check that we can safely access the Inventor nodes + if (constrId >= edit->constrGroup->getNumChildren()) { + Base::Console().Warning("Can't update constraint icons because view is not in sync with sketch\n"); + break; + } + // Find the Constraint Icon SoImage Node SoSeparator *sep = static_cast(edit->constrGroup->getChild(constrId));