diff --git a/library/HTMLPurifier/URISchemeRegistry.php b/library/HTMLPurifier/URISchemeRegistry.php
index 4ac8a0b7..f6485347 100644
--- a/library/HTMLPurifier/URISchemeRegistry.php
+++ b/library/HTMLPurifier/URISchemeRegistry.php
@@ -44,6 +44,11 @@ public function getScheme($scheme, $config, $context)
$config = HTMLPurifier_Config::createDefault();
}
+ // Scheme cannot be null
+ if ($scheme === null) {
+ return;
+ }
+
// important, otherwise attacker could include arbitrary file
$allowed_schemes = $config->get('URI.AllowedSchemes');
if (!$config->get('URI.OverrideAllowedSchemes') &&