diff --git a/lib/private/app.php b/lib/private/app.php
index 1e49fdc60107798d550fb2461a1d94c9039bed76..83b2e8cd7605d98ae764fedac215627ae10c83c4 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -779,7 +779,7 @@ class OC_App {
 			if (is_resource($dh)) {
 				while (($file = readdir($dh)) !== false) {
 
-					if ($file[0] != '.' and is_file($apps_dir['path'] . '/' . $file . '/appinfo/info.xml')) {
+					if ($file[0] != '.' and is_dir($apps_dir['path'] . '/' . $file) and is_file($apps_dir['path'] . '/' . $file . '/appinfo/info.xml')) {
 
 						$apps[] = $file;