]> BookStack Code Mirror - bookstack/commitdiff
PageContent return null issue
authorJames Geiger <redacted>
Tue, 9 Feb 2021 06:21:07 +0000 (00:21 -0600)
committerJames Geiger <redacted>
Tue, 9 Feb 2021 06:21:07 +0000 (00:21 -0600)
app/Entities/Tools/PageContent.php

index e5ea454e71f2499cddeadc31ce2d019ac0a424c9..51562e71f01b38cc8935b9a7e6f32c36138155e4 100644 (file)
@@ -370,6 +370,6 @@ class PageContent
         $dom->loadHTML($htmlContent);
         $images = $dom->getElementsByTagName('img');
 
-        return $images[0]->getAttribute('src');
+        return $images ? $images[0]->getAttribute('src') : null;
     }
 }