diff --git a/src/Facebook/InstantArticles/Transformer/Getters/MultipleElementsGetter.php b/src/Facebook/InstantArticles/Transformer/Getters/MultipleElementsGetter.php index 8ecbba6d..eacaa108 100644 --- a/src/Facebook/InstantArticles/Transformer/Getters/MultipleElementsGetter.php +++ b/src/Facebook/InstantArticles/Transformer/Getters/MultipleElementsGetter.php @@ -31,7 +31,12 @@ public function get($node) { $fragment = $node->ownerDocument->createDocumentFragment(); foreach ($this->children as $child) { - $cloned_node = Transformer::cloneNode($child->get($node)); + $childNode = $child->get($node); + if ($childNode === null) { + continue; + } + $cloned_node = Transformer::cloneNode($childNode); + if (Type::is($cloned_node, 'DOMNode')) { $fragment->appendChild($cloned_node); }