Skip to content

Commit

Permalink
Fix #19066 - Array offset error due to empty file versions array
Browse files Browse the repository at this point in the history
Signed-off-by: Liam JACK <liamjack@users.noreply.github.com>
  • Loading branch information
liamjack authored and backportbot[bot] committed Apr 21, 2020
1 parent 2cf8fab commit d2dae7c
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 @@ -649,6 +649,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 d2dae7c

Please sign in to comment.