[TD]fix crash on corrupt reference

This commit is contained in:
wandererfan
2024-04-17 10:09:10 -04:00
committed by WandererFan
parent e7069e6797
commit 1bd3379bef
3 changed files with 21 additions and 23 deletions

View File

@@ -1836,7 +1836,8 @@ std::string DrawUtil::translateArbitrary(std::string context, std::string baseNa
bool DrawUtil::isCosmeticVertex(App::DocumentObject* owner, std::string element)
{
auto ownerView = static_cast<TechDraw::DrawViewPart*>(owner);
auto vertex = ownerView->getVertex(element);
auto vertexIndex = DrawUtil::getIndexFromName(element);
auto vertex = ownerView->getProjVertexByIndex(vertexIndex);
if (vertex) {
return vertex->getCosmetic();
}