mirror of
https://github.com/getgrav/grav.git
synced 2026-03-04 03:21:33 +01:00
Flex: Fixed a bug if there's no entries in the index
This commit is contained in:
@@ -70,7 +70,8 @@ class FlexIndex extends ObjectIndex implements FlexCollectionInterface, FlexInde
|
||||
{
|
||||
parent::__construct($entries);
|
||||
|
||||
$keys = array_keys(reset($entries));
|
||||
$first = reset($entries);
|
||||
$keys = $first ? array_keys($first) : [];
|
||||
$keys = array_combine($keys, $keys) + ['key' => 'key', 'flex_key' => 'flex_key'];
|
||||
|
||||
$this->_flexDirectory = $flexDirectory;
|
||||
|
||||
Reference in New Issue
Block a user