diff --git a/src/ReflectionClosure.php b/src/ReflectionClosure.php
index 8c55ba1..76745b6 100644
--- a/src/ReflectionClosure.php
+++ b/src/ReflectionClosure.php
@@ -626,6 +626,10 @@ class ReflectionClosure extends ReflectionFunction
      */
     protected function getFileTokens()
     {
+        if (stripos($this->getFileName(), "eval()'d code") > 0) {
+            // In this use case the code is not in a file, it is loaded from the database and eval()'d, so no filename, no tokens.
+            return NULL;
+        }
         $key = $this->getHashedFileName();
 
         if (!isset(static::$files[$key])) {
@@ -642,6 +646,9 @@ class ReflectionClosure extends ReflectionFunction
     {
         if ($this->tokens === null) {
             $tokens = $this->getFileTokens();
+            if ($tokens === null) {
+              return NULL;
+            }
             $startLine = $this->getStartLine();
             $endLine = $this->getEndLine();
             $results = array();
