Skip to content

Commit ed7d1c1

Browse files
authored
Merge pull request #636 from magefan/magefan-patch-42
invalid argument supplied for foreach() in ShortContentExtractor.php
2 parents bd8a930 + f9b014b commit ed7d1c1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Model/ShortContentExtractor.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@ private function setPageBreakOnLen(string $content, $len): string
156156
return;
157157
}
158158

159-
foreach ($node->childNodes as $child) {
160-
$processNode($child);
159+
if ($node->childNodes) {
160+
foreach ($node->childNodes as $child) {
161+
$processNode($child);
162+
}
161163
}
162164

163165
if ($node->nodeType === XML_TEXT_NODE) {

0 commit comments

Comments
 (0)