diff --git a/lib/XRay/Formats/HTML.php b/lib/XRay/Formats/HTML.php
index eb53c7e..9219610 100644
--- a/lib/XRay/Formats/HTML.php
+++ b/lib/XRay/Formats/HTML.php
@@ -25,6 +25,9 @@ class HTML extends Format {
// attempt to parse the page as HTML
$doc = new DOMDocument();
+ if (empty($html)) {
+ $html=' '; // ugly hack to make DOMDocument happy
+ };
@$doc->loadHTML(self::toHtmlEntities($html));
if(!$doc) {