PD: Check threadType before using to index
Coverity issue 545314
This commit is contained in:
committed by
Benjamin Nauck
parent
23824028c1
commit
8f2e330a53
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user