Reviewed by Ken.
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Oct 2004 19:51:14 +0000 (19:51 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Oct 2004 19:51:14 +0000 (19:51 +0000)
        - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
        needed a nil check to handle empty document case

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7837 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/htmlediting.cpp

index 97a8f56..4bf418e 100644 (file)
@@ -1,3 +1,13 @@
+2004-10-14  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Ken.
+        
+        - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
+
+        * khtml/editing/htmlediting.cpp:
+        (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
+        needed a nil check to handle empty document case
+
 2004-10-13  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Ken.
index 1f99dff..5c68a0e 100644 (file)
@@ -835,7 +835,7 @@ void CompositeEditCommand::removeBlockPlaceholderIfNeeded(NodeImpl *node)
     // Of course, a person who hand-edits an HTML file could move a 
     // placeholder around, but it seems OK to be unconcerned about that case.
     NodeImpl *last = node->lastChild();
-    if (last->isHTMLElement()) {
+    if (last && last->isHTMLElement()) {
         ElementImpl *element = static_cast<ElementImpl *>(last);
         if (element->getAttribute(ATTR_CLASS) == blockPlaceholderClassString())
             removeNode(element);