From 14d68de6614cff9ee4ff1ffafa572a36f0eccad3 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 9 Jan 2019 17:34:25 +0300 Subject: [PATCH] Fix possible exception in case if deflection parameter is not defined in preferences --- src/XGUI/XGUI_Displayer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 6c54faa53..8eb1c1261 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -697,7 +698,10 @@ Handle(AIS_InteractiveContext) XGUI_Displayer::AISContext() const ModuleBase_IViewer::DefaultHighlightDrawer = aContext->HighlightStyle(); Handle(Prs3d_Drawer) aSelStyle = aContext->SelectionStyle(); - double aDeflection = Config_PropManager::real("Visualization", "construction_deflection"); + double aDeflection = QString(ModelAPI_ResultConstruction::DEFAULT_DEFLECTION().c_str()).toDouble(); + try { + aDeflection = Config_PropManager::real("Visualization", "construction_deflection"); + } catch (...) {} ModuleBase_IViewer::DefaultHighlightDrawer->SetDeviationCoefficient(aDeflection); aSelStyle->SetDeviationCoefficient(aDeflection); -- 2.39.2