diff --git a/lib/Util/pQuery/pQuery.php b/lib/Util/pQuery/pQuery.php index 95c8ddc0e6..2ee5dd3bfa 100644 --- a/lib/Util/pQuery/pQuery.php +++ b/lib/Util/pQuery/pQuery.php @@ -6,6 +6,12 @@ namespace MailPoet\Util\pQuery; class pQuery extends \pQuery { public static function parseStr($html) { $parser = new Html5Parser($html); + + if (!$parser->root instanceof \pQuery\DomNode) { + // this condition shouldn't happen it is here only for PHPStan + throw new \Exception('Renderer is not configured correctly'); + } + return $parser->root; } }