Cover case when we can safely ignore broken union details operation.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2020-01-11 15:08:55 +02:00
parent c81faf3537
commit 2a95c41bb7

View File

@ -1647,10 +1647,19 @@ void UniteDetails(const VToolUnionDetailsInitData &initData)
} }
else else
{ {
const VPiecePath d1Path = GetPiece1MainPath(initData.doc, initData.id); try
const VPiecePath d2Path = GetPiece2MainPath(initData.doc, initData.id); {
UnionInitParameters(initData, d1Path, d2Path, det1p1, dx, dy, angle); const VPiecePath d1Path = GetPiece1MainPath(initData.doc, initData.id);
UpdateUnitedDetail(initData, dx, dy, det1p1.GetId(), angle); const VPiecePath d2Path = GetPiece2MainPath(initData.doc, initData.id);
UnionInitParameters(initData, d1Path, d2Path, det1p1, dx, dy, angle);
UpdateUnitedDetail(initData, dx, dy, det1p1.GetId(), angle);
}
catch (const VExceptionBadId &)
{
// There is a chance that the tool depends on an already deleted object. We can skip updating in this case.
// We still can get error in child in case we should not get an error here. Debug will be a little bit
// obscured. But if this happened something really bad happened.
}
} }
} }
} // static functions } // static functions