Merge pull request #20578 from nextcloud/backport/20449/stable18

[stable18] Array offset error due to empty file versions array
This commit is contained in:
Morris Jobke 2020-04-24 14:44:21 +02:00 committed by GitHub
commit ddd7a8dba5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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;