Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(906)

Unified Diff: Source/core/editing/ReplaceSelectionCommand.cpp

Issue 220233013: Don't return null from ReplaceSelectionCommand::insertAsListItems() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-04-03T01:25:13 Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/editing/execCommand/crash-replacing-list-by-list-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ReplaceSelectionCommand.cpp
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp
index 8b8f99f1294b1b0e365e04c3fd0b0dbcf2b34957..fc6340fce51e5be5bca1dec3614f1758279af162 100644
--- a/Source/core/editing/ReplaceSelectionCommand.cpp
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp
@@ -1447,8 +1447,10 @@ Node* ReplaceSelectionCommand::insertAsListItems(PassRefPtr<HTMLElement> prpList
} else
ASSERT_NOT_REACHED();
}
- if (isStart || isMiddle)
- lastNode = lastNode->previousSibling();
+ if (isStart || isMiddle) {
+ if (Node* node = lastNode->previousSibling())
+ return node;
+ }
return lastNode;
}
« no previous file with comments | « LayoutTests/editing/execCommand/crash-replacing-list-by-list-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698