[Measure] Fix seg fault in MeasurePosition::execute if subElements is empty (#22016)

* [Measure] take into account if subElements is empty

* [Measure] Remove unnecessary else block
This commit is contained in:
Syres916
2025-06-23 16:44:51 +01:00
committed by GitHub
parent 8c2eb14efe
commit 7e6775d2c0

View File

@@ -95,7 +95,9 @@ App::DocumentObjectExecReturn* MeasurePosition::execute()
{
const App::DocumentObject* object = Element.getValue();
const std::vector<std::string>& subElements = Element.getSubValues();
if (subElements.empty()) {
return {};
}
App::SubObjectT subject {object, subElements.front().c_str()};
auto info = getMeasureInfo(subject);