Skip to content

Commit

Permalink
Merge pull request #20579 from nextcloud/backport/20449/stable17
Browse files Browse the repository at this point in the history
[stable17] Array offset error due to empty file versions array
  • Loading branch information
MorrisJobke authored Apr 24, 2020
2 parents 8e86a45 + e24e395 commit 7da291b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/files_versions/lib/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,11 @@ protected static function getAutoExpireList($time, $versions) {
}

$firstVersion = reset($versions);

if ($firstVersion === false) {
return [$toDelete, $size];
}

$firstKey = key($versions);
$prevTimestamp = $firstVersion['version'];
$nextVersion = $firstVersion['version'] - $step;
Expand Down

0 comments on commit 7da291b

Please sign in to comment.