diff --git a/system/src/Grav/Framework/Flex/FlexIndex.php b/system/src/Grav/Framework/Flex/FlexIndex.php
index <HASH>..<HASH> 100644
--- a/system/src/Grav/Framework/Flex/FlexIndex.php
+++ b/system/src/Grav/Framework/Flex/FlexIndex.php
@@ -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;
Flex: Fixed a bug if there's no entries in the index