Gui: Fix segfault in align to selection tool

This commit is contained in:
Bas Ruigrok
2024-09-20 08:06:45 -05:00
committed by Chris Hennes
parent d0e0cf112f
commit acbce24dd9
+2 -1
View File
@@ -3380,7 +3380,8 @@ void View3DInventorViewer::alignToSelection()
const auto globalPlacement = App::GeoFeature::getGlobalPlacement(selection[0].pResolvedObject, selection[0].pObject, elementName.oldName);
const auto rotation = globalPlacement.getRotation() * geoFeature->Placement.getValue().getRotation().inverse();
const auto geoFeatureSubName = Base::Tools::splitSubName(elementName.oldName).back();
const auto splitSubName = Base::Tools::splitSubName(elementName.oldName);
const auto geoFeatureSubName = !splitSubName.empty() ? splitSubName.back() : "";
Base::Vector3d direction;
if (geoFeature->getCameraAlignmentDirection(direction, geoFeatureSubName.c_str())) {