Commit e49b0670 authored by Ulf Hermann's avatar Ulf Hermann Committed by Thomas Hartmann

QmlJS: Don't crash if the type stack is empty

Change-Id: If4e0155e8167f3edee1890dee5fd8b19623bba17
Reviewed-by: default avatarThomas Hartmann <>
parent 79733e56
......@@ -1551,7 +1551,8 @@ bool Check::visit(CallExpression *ast)
// We have to allow the qsTr function for translation.
bool isTranslationFunction = (name == QLatin1String("qsTr") || name == QLatin1String("qsTrId"));
// allow adding connections with the help of the qt quick designer ui
bool isDirectInConnectionsScope = m_typeStack.last() == QLatin1String("Connections");
bool isDirectInConnectionsScope =
(!m_typeStack.isEmpty() && m_typeStack.last() == QLatin1String("Connections"));
if (!isTranslationFunction && !isDirectInConnectionsScope)
addMessage(ErrFunctionsNotSupportedInQmlUi, location);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment