Sketcher: prevent crash when accessing null pointer

This commit is contained in:
mwganson
2022-01-14 11:25:27 -06:00
committed by wmayer
parent b35623e680
commit a4582d8d61

View File

@@ -1208,6 +1208,11 @@ Base::Vector3d EditModeConstraintCoinManager::seekConstraintPosition(const Base:
relPos = norm * 0.5f + dir * multiplier;
freePos = origPos + relPos * scaled_step;
// Prevent crash : https://forum.freecadweb.org/viewtopic.php?f=8&t=65305
if (!rp) {
return relPos * step;
}
rp->setRadius(0.1f);
rp->setPickAll(true);
rp->setRay(SbVec3f(freePos.x, freePos.y, -1.f), SbVec3f(0, 0, 1) );