The crash happens because the UnitExpression is null and thus segfaults when trying to access the unit and scalar value. This fixes https://github.com/FreeCAD/FreeCAD/issues/23222
The crash happens because the UnitExpression is null and thus segfaults when trying to access the unit and scalar value. This fixes https://github.com/FreeCAD/FreeCAD/issues/23222