QmlJSCheck: Fix crash

Task-number: QDS-2766
Change-Id: I4b0e81b8104ac35a286a318e87e95ea022ed66f6
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Thomas Hartmann
2020-09-11 07:00:30 +02:00
parent d14be7493f
commit f641434ec1

View File

@@ -1838,7 +1838,10 @@ const Value *Check::checkScopeObjectMember(const UiQualifiedId *id)
const bool isListElementScope = (!m_typeStack.isEmpty() && m_typeStack.last() == "ListElement");
if (!value && !isListElementScope) {
if (isListElementScope)
return nullptr;
if (!value) {
addMessage(ErrInvalidPropertyName, id->identifierToken, propertyName);
return nullptr;
}