diff --git a/jsonld.php b/jsonld.php index 9543c23..17b6342 100644 --- a/jsonld.php +++ b/jsonld.php @@ -182,7 +182,7 @@ function jsonld_resolve_url($url) { return $result; } -/** Registered RDF Statement parsers hashed by content-type. */ +/** Registered global RDF Statement parsers hashed by content-type. */ $jsonld_rdf_parsers = new stdClass(); /** @@ -205,8 +205,10 @@ function jsonld_register_rdf_parser($content_type, $parser) { * @param string $content_type the content-type for the parser. */ function jsonld_unregister_rdf_parser($content_type) { - global $jsonld_rdf_parsers; - unset($jsonld_rdf_parsers->{$content_type}); + global $jsonld_rdf_parsers; + if(property_exists($jsonld_rdf_parsers, $content_type)) { + unset($jsonld_rdf_parsers->{$content_type}); + } } /**