We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32d84db commit dc6caf0Copy full SHA for dc6caf0
src/LinkedData.php
@@ -8,6 +8,7 @@
8
use ML\JsonLD\DocumentInterface;
9
use ML\JsonLD\GraphInterface;
10
use ML\JsonLD\Node;
11
+use Throwable;
12
13
class LinkedData
14
{
@@ -37,7 +38,12 @@ private function get(string ...$keys)
37
38
private function getGraph(string $name = null): ?GraphInterface
39
40
if (!isset($this->document)) {
- $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
+ }
47
}
48
49
return $this->document->getGraph();
0 commit comments