aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlscriptstring.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-04-19 13:16:54 +0200
committerUlf Hermann <ulf.hermann@qt.io>2023-04-19 20:01:09 +0200
commit239ad232d0f1e96c1c1812c5b9839fe3062f9ddc (patch)
tree443786cd616c7bb894e7e82775038f4d8a025456 /src/qml/qml/qqmlscriptstring.cpp
parent7c2e31c34fb145ea448b58a310420244d8a80481 (diff)
Qml: Fix QQmlScriptString::isEmpty()
A QQmlScriptString without a d pointer is indeed empty. Task-number: QTBUG-112859 Change-Id: Ic3aea676403bd815e73d26733392c7f6ac8b84b8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlscriptstring.cpp')
-rw-r--r--src/qml/qml/qqmlscriptstring.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlscriptstring.cpp b/src/qml/qml/qqmlscriptstring.cpp
index d478136085..d263587045 100644
--- a/src/qml/qml/qqmlscriptstring.cpp
+++ b/src/qml/qml/qqmlscriptstring.cpp
@@ -128,7 +128,9 @@ Returns whether the QQmlScriptString is empty.
*/
bool QQmlScriptString::isEmpty() const
{
- if (!d || !d->script.isEmpty())
+ if (!d)
+ return true;
+ if (!d->script.isEmpty())
return false;
return d->bindingId == -1;
}