diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index 4c87a6be1..16d320667 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -437,7 +437,7 @@ App::get('/v1/database/collections/:collectionId/documents') } $types = []; - foreach ($collection->getAttribute('rules') as $rule) { + foreach ($collection->getAttribute('rules', []) as $rule) { /** @var Document $rule */ $types[$rule->getAttribute('key')] = $rule->getAttribute('type'); } @@ -630,4 +630,4 @@ App::delete('/v1/database/collections/:collectionId/documents/:documentId') ; $response->noContent(); - }); \ No newline at end of file + });