diff --git a/lib/DocblockResolver.php b/lib/DocblockResolver.php
index <HASH>..<HASH> 100644
--- a/lib/DocblockResolver.php
+++ b/lib/DocblockResolver.php
@@ -17,7 +17,9 @@ class DocblockResolver
         }
 
         if (preg_match('#inheritdoc#i', $node->getLeadingCommentAndWhitespaceText())) {
-            return $class->parent()->methods()->get($node->getName())->type();
+            if ($class->parent()) {
+                return $class->parent()->methods()->get($node->getName())->type();
+            }
         }
 
         return Type::unknown();
TODO: Added test for inheritdoc