diff --git a/plugins/tools/selectiontools/kis_tool_select_contiguous.cc b/plugins/tools/selectiontools/kis_tool_select_contiguous.cc --- a/plugins/tools/selectiontools/kis_tool_select_contiguous.cc +++ b/plugins/tools/selectiontools/kis_tool_select_contiguous.cc @@ -167,7 +167,7 @@ selectionWidget->disableSelectionModeOption(); QVBoxLayout * l = dynamic_cast(selectionWidget->layout()); - Q_ASSERT(l); + KIS_SAFE_ASSERT_RECOVER_RETURN(l); if (l) { QGridLayout * gridLayout = new QGridLayout(); diff --git a/plugins/tools/selectiontools/kis_tool_select_elliptical.cc b/plugins/tools/selectiontools/kis_tool_select_elliptical.cc --- a/plugins/tools/selectiontools/kis_tool_select_elliptical.cc +++ b/plugins/tools/selectiontools/kis_tool_select_elliptical.cc @@ -52,7 +52,7 @@ Q_UNUSED(roundCornersY); KisCanvas2 * kisCanvas = dynamic_cast(canvas()); - Q_ASSERT(kisCanvas); + KIS_SAFE_ASSERT_RECOVER_RETURN(kisCanvas); KisSelectionToolHelper helper(kisCanvas, kundo2_i18n("Select Ellipse")); diff --git a/plugins/tools/selectiontools/kis_tool_select_polygonal.cc b/plugins/tools/selectiontools/kis_tool_select_polygonal.cc --- a/plugins/tools/selectiontools/kis_tool_select_polygonal.cc +++ b/plugins/tools/selectiontools/kis_tool_select_polygonal.cc @@ -48,9 +48,7 @@ void __KisToolSelectPolygonalLocal::finishPolyline(const QVector &points) { KisCanvas2 * kisCanvas = dynamic_cast(canvas()); - Q_ASSERT(kisCanvas); - if (!kisCanvas) - return; + KIS_SAFE_ASSERT_RECOVER_RETURN(kisCanvas); KisSelectionToolHelper helper(kisCanvas, kundo2_i18n("Select Polygon")); diff --git a/plugins/tools/selectiontools/kis_tool_select_similar.cc b/plugins/tools/selectiontools/kis_tool_select_similar.cc --- a/plugins/tools/selectiontools/kis_tool_select_similar.cc +++ b/plugins/tools/selectiontools/kis_tool_select_similar.cc @@ -164,7 +164,7 @@ connect(input, SIGNAL(valueChanged(int)), this, SLOT(slotSetFuzziness(int))); QVBoxLayout* l = dynamic_cast(selectionWidget->layout()); - Q_ASSERT(l); + KIS_SAFE_ASSERT_RECOVER_RETURN(l); l->insertLayout(1, fl); // load setting from config