Index: Source/core/editing/TextIterator.cpp |
diff --git a/Source/core/editing/TextIterator.cpp b/Source/core/editing/TextIterator.cpp |
index 0898f2bae71f4423ccfdf505046a2429e77cd8fb..c888da23049d39d8c0009db256121216260de5fd 100644 |
--- a/Source/core/editing/TextIterator.cpp |
+++ b/Source/core/editing/TextIterator.cpp |
@@ -930,10 +930,11 @@ static bool shouldEmitNewlineAfterNode(Node& node) |
// Check if this is the very last renderer in the document. |
// If so, then we should not emit a newline. |
Node* next = &node; |
- while ((next = NodeTraversal::nextSkippingChildren(*next))) { |
- if (next->renderer()) |
+ do { |
+ next = NodeTraversal::nextSkippingChildren(*next); |
+ if (next && next->renderer()) |
return true; |
- } |
+ } while (next); |
return false; |
} |