From 49cb974bcab4fa77d261cd89fda76a876aa5560e Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 3 Feb 2020 14:39:54 +0100 Subject: [PATCH] Gui: [skip ci] handle possible division by zero in NaviCube --- src/Gui/NaviCube.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Gui/NaviCube.cpp b/src/Gui/NaviCube.cpp index 391134c3e4..97464e72d4 100644 --- a/src/Gui/NaviCube.cpp +++ b/src/Gui/NaviCube.cpp @@ -1157,7 +1157,8 @@ bool NaviCubeImplementation::mouseReleased(short x, short y) { int pick = pickFace(x, y); ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); - float rotStepAngle = 360.0f/hGrp->GetInt("NaviStepByTurn",8); + long step = Base::clamp(hGrp->GetInt("NaviStepByTurn",8), 4L, 36L); + float rotStepAngle = 360.0f/step; switch (pick) { default: