PD: Check threadType before using to index

Coverity issue 545314
This commit is contained in:
Chris Hennes
2025-03-20 23:46:24 -05:00
committed by Benjamin Nauck
parent 23824028c1
commit 8f2e330a53

View File

@@ -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)