Check for existing RDF parser before removal.

This commit is contained in:
Dave Longley 2012-05-09 16:40:22 -04:00
parent a4d73b0bb7
commit aef8eb3e72

View file

@ -182,7 +182,7 @@ function jsonld_resolve_url($url) {
return $result; return $result;
} }
/** Registered RDF Statement parsers hashed by content-type. */ /** Registered global RDF Statement parsers hashed by content-type. */
$jsonld_rdf_parsers = new stdClass(); $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. * @param string $content_type the content-type for the parser.
*/ */
function jsonld_unregister_rdf_parser($content_type) { function jsonld_unregister_rdf_parser($content_type) {
global $jsonld_rdf_parsers; global $jsonld_rdf_parsers;
unset($jsonld_rdf_parsers->{$content_type}); if(property_exists($jsonld_rdf_parsers, $content_type)) {
unset($jsonld_rdf_parsers->{$content_type});
}
} }
/** /**