From 8d0c224992330592feac27c6f9be747ec33f5b3a Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Tue, 9 Apr 2013 11:34:31 -0400 Subject: [PATCH] Throw error if compaction context is null. --- jsonld.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jsonld.php b/jsonld.php index 53b18cc..db87931 100644 --- a/jsonld.php +++ b/jsonld.php @@ -612,6 +612,12 @@ class JsonLdProcessor { * @return mixed the compacted JSON-LD output. */ public function compact($input, $ctx, $options) { + if($ctx === null) { + throw new JsonLdException( + 'The compaction context must not be null.', + 'jsonld.CompactError'); + } + // nothing to compact if($input === null) { return null;