Skip to content

Commit

Permalink
[PartDesign] [skip ci] #fixes 4367: Thread size out of range using ho…
Browse files Browse the repository at this point in the history
…le-feature
  • Loading branch information
wwmayer committed Aug 24, 2020
1 parent c714dd0 commit 30bc9fc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Mod/PartDesign/App/FeatureHole.cpp
Expand Up @@ -536,10 +536,20 @@ void Hole::updateDiameterParam()

int threadType = ThreadType.getValue();
int threadSize = ThreadSize.getValue();
if (threadType < 0)
if (threadType < 0) {
// When restoring the feature it might be in an inconsistent state.
// So, just silently ignore it instead of throwing an exception.
if (isRestoring())
return;
throw Base::IndexError("Thread type out of range");
if (threadSize < 0)
}
if (threadSize < 0) {
// When restoring the feature it might be in an inconsistent state.
// So, just silently ignore it instead of throwing an exception.
if (isRestoring())
return;
throw Base::IndexError("Thread size out of range");
}
double diameter = threadDescription[threadType][threadSize].diameter;
double pitch = threadDescription[threadType][threadSize].pitch;

Expand Down

0 comments on commit 30bc9fc

Please sign in to comment.