aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v4/qv4irbuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/v4/qv4irbuilder.cpp')
-rw-r--r--src/qml/qml/v4/qv4irbuilder.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/qml/qml/v4/qv4irbuilder.cpp b/src/qml/qml/v4/qv4irbuilder.cpp
index 4aa257d54a..d217b5e2f5 100644
--- a/src/qml/qml/v4/qv4irbuilder.cpp
+++ b/src/qml/qml/v4/qv4irbuilder.cpp
@@ -638,7 +638,14 @@ bool QV4IRBuilder::visit(AST::FieldMemberExpression *ast)
QByteArray utf8Name = name.toUtf8();
const char *enumName = utf8Name.constData();
- const QMetaObject *meta = baseName->meta.propertyCache(m_engine)->firstCppMetaObject();
+ const QQmlPropertyCache *cache = baseName->meta.propertyCache(m_engine);
+ if (!cache) {
+ //Happens in some cases where they make properties with uppercase names
+ qFatal("QV4: Unable to resolve enum: '%s'",
+ QString(*baseName->id + QLatin1Char('.') + ast->name.toString()).toLatin1().constData());
+ }
+
+ const QMetaObject *meta = cache->firstCppMetaObject();
bool found = false;
for (int ii = 0; !found && ii < meta->enumeratorCount(); ++ii) {
QMetaEnum e = meta->enumerator(ii);