forked from qt-creator/qt-creator
QmlJSEditor: Fix nullptr access
Avoids a crash when triggering 'Find Usage' on a Qml Item. Change-Id: I3980e6a7aae891f853148017341a2f29a07e03ad Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -322,11 +322,13 @@ protected:
|
||||
|
||||
bool visit(AST::UiPublicMember *node) override
|
||||
{
|
||||
if (node->memberType->name == _name){
|
||||
if (UiQualifiedId *memberType = node->memberType) {
|
||||
if (memberType->name == _name) {
|
||||
const ObjectValue * tVal = _context->lookupType(_doc.data(), QStringList(_name));
|
||||
if (tVal == _typeValue)
|
||||
_usages.append(node->typeToken);
|
||||
}
|
||||
}
|
||||
if (AST::cast<Block *>(node->statement)) {
|
||||
_builder.push(node);
|
||||
Node::accept(node->statement, this);
|
||||
|
Reference in New Issue
Block a user