From 2681f684c7ceed8b3de70223582e947c4b83143b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 3 Dec 2014 18:06:22 +0300 Subject: [PATCH] af_comics_pa: check node exists before trying to manipulate it --- plugins/af_comics/filters/af_comics_pa.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/af_comics/filters/af_comics_pa.php b/plugins/af_comics/filters/af_comics_pa.php index a13857cc..0848adbd 100644 --- a/plugins/af_comics/filters/af_comics_pa.php +++ b/plugins/af_comics/filters/af_comics_pa.php @@ -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) { -- 2.39.5