diff --git a/src/plugins/qmljseditor/qmljshoverhandler.cpp b/src/plugins/qmljseditor/qmljshoverhandler.cpp index d2c5797c7e8..952d6d7d0fb 100644 --- a/src/plugins/qmljseditor/qmljshoverhandler.cpp +++ b/src/plugins/qmljseditor/qmljshoverhandler.cpp @@ -305,9 +305,10 @@ void HoverHandler::prettyPrintTooltip(const QmlJS::Value *value, } if (toolTip().isEmpty()) { - QString typeId = context->valueOwner()->typeId(value); - if (typeId != QLatin1String("undefined")) + if (!value->asUndefinedValue() && !value->asUnknownValue()) { + const QString typeId = context->valueOwner()->typeId(value); setToolTip(typeId); + } } }