]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix #19066 - Array offset error due to empty file versions array 20578/head
authorLiam JACK <liamjack@users.noreply.github.com>
Sun, 12 Apr 2020 13:35:17 +0000 (15:35 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 21 Apr 2020 08:46:52 +0000 (08:46 +0000)
Signed-off-by: Liam JACK <liamjack@users.noreply.github.com>
apps/files_versions/lib/Storage.php

index 8df98d087d85b84dd6f6f809ed767f779553b668..de71e2044eba5821aa9447f36019581c0277f110 100644 (file)
@@ -649,6 +649,11 @@ class Storage {
                }
 
                $firstVersion = reset($versions);
+
+               if ($firstVersion === false) {
+                       return [$toDelete, $size];
+               }
+
                $firstKey = key($versions);
                $prevTimestamp = $firstVersion['version'];
                $nextVersion = $firstVersion['version'] - $step;