forked from qt-creator/qt-creator
qmljs/qmljshoverhandler: fix possible deref of null
Change-Id: I7fc02b4f36fd34a94344bc0956b0daf731e73d17 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
@@ -461,10 +461,11 @@ bool HoverHandler::setQmlHelpItem(const ScopeChain &scopeChain,
|
||||
if (const ObjectValue *scope = isMember(scopeChain, node, &name)) {
|
||||
// maybe it's a type?
|
||||
if (!name.isEmpty() && name.at(0).isUpper()) {
|
||||
AST::UiQualifiedId *qualifiedId = AST::cast<AST::UiQualifiedId *>(node);
|
||||
const ObjectValue *value = scopeChain.context()->lookupType(qmlDocument.data(), qualifiedId);
|
||||
if (setQmlTypeHelp(scopeChain, qmlDocument, value, QStringList(qualifiedId->name.toString())))
|
||||
return true;
|
||||
if (AST::UiQualifiedId *qualifiedId = AST::cast<AST::UiQualifiedId *>(node)) {
|
||||
const ObjectValue *value = scopeChain.context()->lookupType(qmlDocument.data(), qualifiedId);
|
||||
if (setQmlTypeHelp(scopeChain, qmlDocument, value, QStringList(qualifiedId->name.toString())))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise, it's probably a property
|
||||
|
||||
Reference in New Issue
Block a user