Skip to content

Commit

Permalink
[TD]fix crash on bad selection (fix FreeCAD#16727)
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Sep 23, 2024
1 parent 9b409da commit 98e9046
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Mod/TechDraw/Gui/CommandAnnotate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1633,8 +1633,9 @@ void CmdTechDrawSurfaceFinishSymbols::activated(int iMsg)
}
else {
auto objFeat = dynamic_cast<TechDraw::DrawView *>(selection.front().getObject());
if (!objFeat->isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId())
&& !objFeat->isDerivedFrom(TechDraw::DrawLeaderLine::getClassTypeId())) {
if ( !objFeat ||
!(objFeat->isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId()) ||
objFeat->isDerivedFrom(TechDraw::DrawLeaderLine::getClassTypeId())) ) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("SurfaceFinishSymbols"),
QObject::tr("Selected object is not a part view, nor a leader line"));
return;
Expand Down

0 comments on commit 98e9046

Please sign in to comment.