diff --git a/src/Mod/PartDesign/App/FeatureHole.cpp b/src/Mod/PartDesign/App/FeatureHole.cpp index 4cc4cb86e9..32c07f445e 100644 --- a/src/Mod/PartDesign/App/FeatureHole.cpp +++ b/src/Mod/PartDesign/App/FeatureHole.cpp @@ -1371,6 +1371,9 @@ void Hole::findClosestDesignation() // Intended for thread type changes // finds the closest diameter of the new thread type int threadType = ThreadType.getValue(); + if (threadType == -1) { + throw Base::IndexError(QT_TRANSLATE_NOOP("Exception", "Thread type is invalid")); + } int closestSize = 0; double diameter = ThreadDiameter.getValue(); if (diameter == 0)