From 11e52fc6967d0c745a1db0f8f341fe0ad00d759a Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 14 Sep 2020 14:04:18 +0200 Subject: [PATCH] TechDraw: [skip ci] Coverity: Dereference null return value --- src/Mod/TechDraw/Gui/CommandAnnotate.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Mod/TechDraw/Gui/CommandAnnotate.cpp b/src/Mod/TechDraw/Gui/CommandAnnotate.cpp index 006537ea99..b48ba22330 100644 --- a/src/Mod/TechDraw/Gui/CommandAnnotate.cpp +++ b/src/Mod/TechDraw/Gui/CommandAnnotate.cpp @@ -1085,9 +1085,11 @@ void execLine2Points(Gui::Command* cmd) for (auto& v2d: vertexNames) { int idx = DrawUtil::getIndexFromName(v2d); TechDraw::Vertex* v = baseFeat->getProjVertexByIndex(idx); - Base::Vector3d p = DrawUtil::invertY(v->pnt); - points.push_back(p / scale); - is3d.push_back(false); + if (v) { + Base::Vector3d p = DrawUtil::invertY(v->pnt); + points.push_back(p / scale); + is3d.push_back(false); + } } } //get the 3D points