Skip to content

Commit dc6caf0

Browse files
committed
ignored errors from linkedData
1 parent 32d84db commit dc6caf0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/LinkedData.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use ML\JsonLD\DocumentInterface;
99
use ML\JsonLD\GraphInterface;
1010
use ML\JsonLD\Node;
11+
use Throwable;
1112

1213
class LinkedData
1314
{
@@ -37,7 +38,12 @@ private function get(string ...$keys)
3738
private function getGraph(string $name = null): ?GraphInterface
3839
{
3940
if (!isset($this->document)) {
40-
$this->document = LdDocument::load(json_encode($this->all()));
41+
try {
42+
$this->document = LdDocument::load(json_encode($this->all()));
43+
} catch (Throwable $throwable) {
44+
$this->document = LdDocument::load('{}');
45+
return null;
46+
}
4147
}
4248

4349
return $this->document->getGraph();

0 commit comments

Comments
 (0)