Index: Source/platform/text/BidiRunList.h |
diff --git a/Source/platform/text/BidiRunList.h b/Source/platform/text/BidiRunList.h |
index bfaaab0de9cc576609802973d6cda072e7a29716..53df3d9314ebbd730ff6ae9b5ff1738e70fadfaa 100644 |
--- a/Source/platform/text/BidiRunList.h |
+++ b/Source/platform/text/BidiRunList.h |
@@ -153,7 +153,7 @@ void BidiRunList<Run>::replaceRunWithRuns(Run* toReplace, BidiRunList<Run>& newR |
} else { |
// Find the run just before "toReplace" in the list of runs. |
Run* previousRun = m_firstRun; |
- while (previousRun->next() != toReplace) |
+ while (previousRun->next() && previousRun->next() != toReplace) |
previousRun = previousRun->next(); |
ASSERT(previousRun); |
previousRun->setNext(newRuns.firstRun()); |