Skip to content

Commit ea171c0

Browse files
committed
Updated list diff, checking for old list, if it is blank or not.
1 parent 33a0d6e commit ea171c0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Caxy/HtmlDiff/ListDiff.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,9 @@ protected function diff()
415415
if ($index['type'] == "list") {
416416
$match = $this->getArrayByColumnValue($this->textMatches, 'new', $index['position']);
417417
$newList = $this->childLists['new'][$match['new']];
418-
$oldList = $this->childLists['old'][$match['old']];
418+
$oldList = array_key_exists($match['old'], $this->childLists['old'])
419+
? $this->childLists['old'][$match['old']]
420+
: '';
419421

420422
$content = "<li>";
421423
$content .= $this->processPlaceholders(
@@ -435,7 +437,7 @@ protected function diff()
435437

436438
$oldDiffOrderIndexMatch = array_key_exists($oldIndexCount, $this->diffOrderIndex['old'])
437439
? $this->diffOrderIndex['old'][$oldIndexCount]
438-
: false;
440+
: '';
439441

440442
$oldContent = $oldDiffOrderIndexMatch && array_key_exists($oldDiffOrderIndexMatch['position'], $this->contentIndex['old'])
441443
? $this->contentIndex['old'][$oldDiffOrderIndexMatch['position']]

0 commit comments

Comments
 (0)