From 8f2e330a538a36346dd1dbe952fbf0f4d1a7d8b1 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Thu, 20 Mar 2025 23:46:24 -0500 Subject: [PATCH] PD: Check threadType before using to index Coverity issue 545314 --- src/Mod/PartDesign/App/FeatureHole.cpp | 3 +++ 1 file changed, 3 insertions(+) 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)