diff --git a/plugins/OStatus/lib/xrd.php b/plugins/OStatus/lib/xrd.php index f00e1f8096..aa13ef0242 100644 --- a/plugins/OStatus/lib/xrd.php +++ b/plugins/OStatus/lib/xrd.php @@ -57,6 +57,9 @@ class XRD throw new Exception("Invalid XML"); } $xrd_element = $dom->getElementsByTagName('XRD')->item(0); + if (!$xrd_element) { + throw new Exception("Invalid XML, missing XRD root"); + } // Check for host-meta host $host = $xrd_element->getElementsByTagName('Host')->item(0);