fix(assembly): guard onChanged against solver during document restore
Some checks failed
Build and Test / build (pull_request) Has been cancelled
Some checks failed
Build and Test / build (pull_request) Has been cancelled
During document restore, PropertyLinkList::Restore sets the Group property on AssemblyObject, triggering onChanged → updateSolveStatus → solve → validateNewPlacements. At this point joints reference objects that haven't been restored yet, causing a null pointer dereference (SIGSEGV). Add an isRestoring() guard to skip solver invocation during restore, matching the existing pattern in AssemblyLink::onChanged().
This commit is contained in:
@@ -139,6 +139,11 @@ App::DocumentObjectExecReturn* AssemblyObject::execute()
|
|||||||
|
|
||||||
void AssemblyObject::onChanged(const App::Property* prop)
|
void AssemblyObject::onChanged(const App::Property* prop)
|
||||||
{
|
{
|
||||||
|
if (App::GetApplication().isRestoring()) {
|
||||||
|
App::Part::onChanged(prop);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (prop == &Group) {
|
if (prop == &Group) {
|
||||||
updateSolveStatus();
|
updateSolveStatus();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user