aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4executablecompilationunit_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-12-20 22:12:31 +0100
committerUlf Hermann <ulf.hermann@qt.io>2024-01-08 09:26:59 +0100
commit5f72764c876058e290e42b0b2f1e77d59f4c914d (patch)
treeea269e684899aafb407a11ae505cc1ceb44f2a2c /src/qml/jsruntime/qv4executablecompilationunit_p.h
parent7c505bdcb345d27d85934c8bfd5267c67d290aa6 (diff)
QtQml: Make QQmlNullableValue somewhat safer
We need it movable, and you shouldn't be able to poke its internals. Change-Id: Ia9fbde26ef525837402d9214aa534eeec0221e2f Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4executablecompilationunit_p.h')
-rw-r--r--src/qml/jsruntime/qv4executablecompilationunit_p.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4executablecompilationunit_p.h b/src/qml/jsruntime/qv4executablecompilationunit_p.h
index 747f776f4a..4cd1ce204e 100644
--- a/src/qml/jsruntime/qv4executablecompilationunit_p.h
+++ b/src/qml/jsruntime/qv4executablecompilationunit_p.h
@@ -99,10 +99,16 @@ public:
// finalUrl() and finalUrlString() shall be used to resolve further URLs referred to in the code
// They are _not_ intercepted and thus represent the "logical" name for the code.
- QUrl url() const { if (m_url.isNull) m_url = QUrl(fileName()); return m_url; }
+ QUrl url() const
+ {
+ if (!m_url.isValid())
+ m_url = QUrl(fileName());
+ return m_url;
+ }
+
QUrl finalUrl() const
{
- if (m_finalUrl.isNull)
+ if (!m_finalUrl.isValid())
m_finalUrl = QUrl(finalUrlString());
return m_finalUrl;
}