diff --git a/src/lib/corelib/language/evaluatorscriptclass.cpp b/src/lib/corelib/language/evaluatorscriptclass.cpp index b7c2576d..a1b1781c 100644 --- a/src/lib/corelib/language/evaluatorscriptclass.cpp +++ b/src/lib/corelib/language/evaluatorscriptclass.cpp @@ -177,8 +177,18 @@ private: QScriptValue originalValue; if (data->item->propertyDeclaration(propertyName->toString()).isScalar()) { const Item *item = itemOfProperty; - while (item->type() == ItemType::ModuleInstance) + int prototypeCount = 0; + while (item && item->type() == ItemType::ModuleInstance) { item = item->prototype(); + ++prototypeCount; + } + if (!item) { + if (!itemOfProperty) + qDebug() << "itemOfProperty was null to begin with"; + else + qDebug() << "module instance with null prototype found; overall prototype count is" << prototypeCount; + return result; + } if (item->type() != ItemType::Module && item->type() != ItemType::Export) { const QString errorMessage = Tr::tr("The special value 'original' can only " "be used with module properties.");