diff --git a/src/Mod/PartDesign/App/FeatureHole.cpp b/src/Mod/PartDesign/App/FeatureHole.cpp index baed9aa286..c55fec5bca 100644 --- a/src/Mod/PartDesign/App/FeatureHole.cpp +++ b/src/Mod/PartDesign/App/FeatureHole.cpp @@ -1176,13 +1176,14 @@ std::optional Hole::determineDiameter() const return std::nullopt; throw Base::IndexError("Thread size out of range"); } - double diameter = threadDescription[threadType][threadSize].diameter; - double pitch = threadDescription[threadType][threadSize].pitch; - double clearance = 0.0; if (threadType == 0) return std::nullopt; + double diameter = threadDescription[threadType][threadSize].diameter; + double pitch = threadDescription[threadType][threadSize].pitch; + double clearance = 0.0; + if (Threaded.getValue()) { if (ModelThread.getValue()) {