diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php
index 3f4ccf7f0a2a7e3fc4b792147c180a89bd0ae7ed..f9dbe449e0da69a938402e9cdb0c2d18bbd75c3e 100644
--- a/apps/files_versions/lib/Storage.php
+++ b/apps/files_versions/lib/Storage.php
@@ -776,7 +776,7 @@ class Storage {
 			// if still not enough free space we rearrange the versions from all files
 			if ($availableSpace <= 0) {
 				$result = Storage::getAllVersions($uid);
-				$allVersions = $result['all'];
+				$allVersions = $result['all'] ?? [];
 
 				foreach ($result['by_file'] as $versions) {
 					list($toDeleteNew, $size) = self::getExpireList($time, $versions, $availableSpace <= 0);