Coverity: Unchecked dynamic_cast

This commit is contained in:
wmayer
2020-07-20 12:37:08 +02:00
parent 1a16cde1f5
commit 45b755a596
6 changed files with 14 additions and 5 deletions

View File

@@ -362,6 +362,9 @@ void CosmeticEdgePy::setCenter(Py::Object arg)
pNew = DrawUtil::invertY(pNew);
auto oldGeom = getCosmeticEdgePtr()->m_geometry;
TechDraw::Circle* oldCircle = dynamic_cast<TechDraw::Circle*>(oldGeom);
if (oldCircle == nullptr) {
throw Py::TypeError("Edge geometry is not a circle");
}
getCosmeticEdgePtr()->permaStart = pNew;
getCosmeticEdgePtr()->permaEnd = pNew;