Browse Source

Throw error if compaction context is null.

master
Dave Longley 10 years ago
parent
commit
8d0c224992
  1. 6
      jsonld.php

6
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;

Loading…
Cancel
Save