Index: Source/core/editing/DOMSelection.cpp |
diff --git a/Source/core/editing/DOMSelection.cpp b/Source/core/editing/DOMSelection.cpp |
index 6012b131dbfb49621d2f7980ef49dffd783e7777..3d06123b7bb1051bf21c53579f7351469100cadc 100644 |
--- a/Source/core/editing/DOMSelection.cpp |
+++ b/Source/core/editing/DOMSelection.cpp |
@@ -197,10 +197,14 @@ int DOMSelection::rangeCount() const |
void DOMSelection::collapse(Node* node, int offset, ExceptionState& exceptionState) |
{ |
- ASSERT(node); |
if (!m_frame) |
return; |
+ if (!node) { |
+ m_frame->selection().clear(); |
+ return; |
+ } |
+ |
if (offset < 0) { |
exceptionState.throwDOMException(IndexSizeError, String::number(offset) + " is not a valid offset."); |
return; |