* Move back util functions to AssemblyUtils again
* Add getPropertyByName<T>() helper
* Improve constness in AssemblyUtils
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add FC_ERR macro for the 'Solve failed' Assembly error
* Handle standard exceptions during assembly solve
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Assembly: removal of object of fixed joint causing crash
FreeCAD is crashing if the 'Object'
property of fixed joint (Assembly/Joints/Fixed/Joint Connector 1/Object1 or
Assembly/Joints/Fixed/Joint Connector 2/Object2) is manually removed.
Steps to reproduce:
- make simple Assembly e.g. of two cubes with Fixed joint
- Select Fixed joint in the tree and go-to property 'Data' tab
- Select 'Object1' or 'Object2' of the 'Joint Connector 1' or 'Joint Connector 2'
and remove this reference
- click by your pointing device (mouse) to the arbitrary other property
The FreeCAD will crash here because the call
App::DocumentObject* obj = getObjFromNameProp(joint, propObjName, propPartName);
will return NULL pointer.
This problem is similar to the
4b5d079e6b.
* Assembly: fixed warning message text
The warning message text is not describing two cases which can happen,
but only one - property of specific joint.
* Assembly: avoiding possible crash in rack pinion joint code
Similar problems:
07c6df61f8456a6b02e88b369dcef5643ac1574e
and
4b5d079e6b
were causing real crashes (Linux + Sway Wayland compositor) when
Fixed joint type was used.
This patch tries to avoid the same situation, but now for the
rack pinion joint type.
The returned pointer value (part1 and obj1) can get NULL pointer value
and is used in the code:
if (obj1->getNameInDocument() != part1->getNameInDocument()) { ....
a few lines later.