forked from friendica/php-json-ld
Throw error if compaction context is null.
This commit is contained in:
parent
a4eb8e6d4b
commit
8d0c224992
|
@ -612,6 +612,12 @@ class JsonLdProcessor {
|
||||||
* @return mixed the compacted JSON-LD output.
|
* @return mixed the compacted JSON-LD output.
|
||||||
*/
|
*/
|
||||||
public function compact($input, $ctx, $options) {
|
public function compact($input, $ctx, $options) {
|
||||||
|
if($ctx === null) {
|
||||||
|
throw new JsonLdException(
|
||||||
|
'The compaction context must not be null.',
|
||||||
|
'jsonld.CompactError');
|
||||||
|
}
|
||||||
|
|
||||||
// nothing to compact
|
// nothing to compact
|
||||||
if($input === null) {
|
if($input === null) {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in a new issue