diff --git a/TextDiff.php b/TextDiff.php index 6590de7..afe2009 100644 --- a/TextDiff.php +++ b/TextDiff.php @@ -149,7 +149,7 @@ private function getWordDiff($old_array, $new_array) ++$count; } else { $before = $count -1; - if(array_key_exists($before, $words) && !array_key_exists('source', $words[$before])) { + if(array_key_exists($before, $words) && is_array($words[$before]) && !array_key_exists('source', $words[$before])) { $words[$before] .= $val; } else { $words[] = $val;