From 2c583d6c989256703f3d808db3f195e5f38779fb Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 4 Feb 2019 11:26:32 +0100 Subject: [PATCH] QmlDesigner: Catch exception Change-Id: I22db80a0d6e7a1c95f6e77f584a177aaa78253bf Reviewed-by: Tim Jenssen --- .../qmldesignerextension/pathtool/pathitem.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathitem.cpp b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathitem.cpp index 0d5b380747d..ad5437f34e9 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathitem.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathitem.cpp @@ -25,6 +25,7 @@ #include "pathitem.h" +#include #include #include #include @@ -840,13 +841,17 @@ void PathItem::updatePathModelNodes(const QList &changedPoints) { PathUpdateDisabler pathUpdateDisabler(this, PathUpdateDisabler::DontUpdatePath); - RewriterTransaction rewriterTransaction = - formEditorItem()->qmlItemNode().view()->beginRewriterTransaction(QByteArrayLiteral("PathItem::createCubicSegmentContextMenu")); + try { + RewriterTransaction rewriterTransaction = + formEditorItem()->qmlItemNode().view()->beginRewriterTransaction(QByteArrayLiteral("PathItem::createCubicSegmentContextMenu")); - foreach (SelectionPoint changedPoint, changedPoints) - changedPoint.controlPoint.updateModelNode(); + foreach (SelectionPoint changedPoint, changedPoints) + changedPoint.controlPoint.updateModelNode(); - rewriterTransaction.commit(); + rewriterTransaction.commit(); + } catch (const Exception &e) { + e.showException(); + } } void PathItem::disablePathUpdates()