Skip to content
Snippets Groups Projects
Unverified Commit b6c76f43 authored by Liam JACK's avatar Liam JACK
Browse files

Fix #19066 - Array offset error due to empty file versions array

parent 89242142
No related branches found
No related tags found
No related merge requests found
......@@ -641,6 +641,11 @@ class Storage {
}
$firstVersion = reset($versions);
if ($firstVersion === false) {
return [$toDelete, $size];
}
$firstKey = key($versions);
$prevTimestamp = $firstVersion['version'];
$nextVersion = $firstVersion['version'] - $step;
......
......@@ -274,6 +274,11 @@ class VersioningTest extends \Test\TestCase {
],
9 // size of all deleted files (every file has the size 1)
],
// fourth set of versions: empty (see issue #19066)
[
[],
0
]
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment