diff --git a/src/Console/Commands/DebugBarAssetsCommand.php b/src/Console/Commands/DebugBarAssetsCommand.php
index <HASH>..<HASH> 100644
--- a/src/Console/Commands/DebugBarAssetsCommand.php
+++ b/src/Console/Commands/DebugBarAssetsCommand.php
@@ -80,8 +80,9 @@ class DebugBarAssetsCommand extends QtCommand
                     }
                 }
             }
+            
+            closedir($dir);
         }
-        closedir($dir);
     }
 
 }
Checking the directory for closedir() funcntion