QmlDesigner: Fix crash

We access the rewriterView() for the decription.

Change-Id: I30883d02ab1a2b12dcd6a2bcac6fae82b97a2f5b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Thomas Hartmann
2022-10-18 17:31:06 +02:00
parent 1523129d50
commit 5ca3db5ff7

View File

@@ -726,10 +726,15 @@ void ModelPrivate::setAuxiliaryData(const InternalNodePointer &node,
void ModelPrivate::resetModelByRewriter(const QString &description)
{
if (rewriterView())
if (rewriterView()) {
rewriterView()->resetToLastCorrectQml();
throw RewritingException(__LINE__, __FUNCTION__, __FILE__, description.toUtf8(), rewriterView()->textModifierContent());
throw RewritingException(__LINE__,
__FUNCTION__,
__FILE__,
description.toUtf8(),
rewriterView()->textModifierContent());
}
}
void ModelPrivate::attachView(AbstractView *view)