diff --git a/src/Mod/Sketcher/Gui/Command.cpp b/src/Mod/Sketcher/Gui/Command.cpp index ceb96a846c..b52ab63a3a 100644 --- a/src/Mod/Sketcher/Gui/Command.cpp +++ b/src/Mod/Sketcher/Gui/Command.cpp @@ -1771,16 +1771,16 @@ void CmdRenderingOrder::updateIcon() Gui::BitmapFactory().iconFromTheme("Sketcher_RenderingOrder_Construction"); static QIcon external = Gui::BitmapFactory().iconFromTheme("Sketcher_RenderingOrder_External"); - auto* pcAction = qobject_cast(getAction()); - - if (TopElement == ElementType::Normal) { - pcAction->setIcon(normal); - } - else if (TopElement == ElementType::Construction) { - pcAction->setIcon(construction); - } - else if (TopElement == ElementType::External) { - pcAction->setIcon(external); + if (auto* pcAction = qobject_cast(getAction())) { + if (TopElement == ElementType::Normal) { + pcAction->setIcon(normal); + } + else if (TopElement == ElementType::Construction) { + pcAction->setIcon(construction); + } + else if (TopElement == ElementType::External) { + pcAction->setIcon(external); + } } }