forked from qt-creator/qt-creator
QmlJS: Don't crash if the type stack is empty
Change-Id: If4e0155e8167f3edee1890dee5fd8b19623bba17 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
This commit is contained in:
committed by
Thomas Hartmann
parent
79733e5625
commit
e49b0670c8
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user