diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp
index 8f371bb28701d36ecfcf8fd873950d40e2b67ca2..e47fbe658127ab192ef824b1a122007014741627 100644
--- a/src/plugins/cppeditor/cpphoverhandler.cpp
+++ b/src/plugins/cppeditor/cpphoverhandler.cpp
@@ -158,8 +158,10 @@ static QString buildHelpId(const FullySpecifiedType &type,
         scope = e->scope();
     } else if (const NamedType *t = type->asNamedType()) {
         name = t->name();
-    } else if (const Declaration *d = symbol->asDeclaration()) {
-        if (d->scope() && d->scope()->owner()->isEnum()) {
+    } else if (symbol && symbol->isDeclaration()) {
+        const Declaration *d = symbol->asDeclaration();
+
+        if (d->scope() && d->scope()->isEnumScope()) {
             name = d->name();
             scope = d->scope();
         }