]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix #19066 - Array offset error due to empty file versions array 20579/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:47:08 +0000 (08:47 +0000)
Signed-off-by: Liam JACK <liamjack@users.noreply.github.com>
apps/files_versions/lib/Storage.php

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