af_comics_pa: check node exists before trying to manipulate it

This commit is contained in:
Andrew Dolgov 2014-12-03 18:06:22 +03:00
parent 3ba0599de7
commit 2681f684c7

View file

@ -56,7 +56,9 @@ class Af_Comics_Pa extends Af_ComicFilter {
if ($header->parentNode) { $header->parentNode->removeChild($header); }
$avatar = $xpath->query('(//div[@class="avatar"]//img)')->item(0);
$basenode->insertBefore($avatar, $basenode->firstChild);
if ($basenode)
$basenode->insertBefore($avatar, $basenode->firstChild);
$uninteresting = $xpath->query('(//div[@class="avatar"])');
foreach ($uninteresting as $i) {