From 72c37f9b7555d175ca6e3dac9855a89dd968ff73 Mon Sep 17 00:00:00 2001 From: jffmichi <> Date: Tue, 11 Feb 2025 01:11:56 +0100 Subject: [PATCH] PartDesign: fix crash when opening a file with a metric hole --- src/Mod/PartDesign/App/FeatureHole.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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()) {