Skip to content

Commit

Permalink
Harden document schema against potential empty tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Toflar committed Feb 16, 2024
1 parent 8a0acbd commit 089e7cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Internal/Index/IndexInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ public function getDocumentSchema(): array
->where("key = 'documentSchema'")
->fetchOne();

$this->documentSchema = Util::decodeJson($schema);
if ($schema === false) {
$this->documentSchema = [];
} else {
$this->documentSchema = Util::decodeJson($schema);
}
}

return $this->documentSchema;
Expand Down

0 comments on commit 089e7cc

Please sign in to comment.