Reviewed by Hyatt.
authorkdecker <kdecker@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Jan 2005 23:25:11 +0000 (23:25 +0000)
committerkdecker <kdecker@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Jan 2005 23:25:11 +0000 (23:25 +0000)
Fixed: <rdar://problem/3936879> nil-deref, crash in InlineFlowBox::nodeAtPoint closing DHTML menus at hrweb.apple.com

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::fillInlineSelectionGaps): Added a nil check. If there is no selection, don't try to get the selection's containing block. If we do, we'll crash.

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/render_block.cpp

index 3779a5a..cb0aa0b 100644 (file)
@@ -1,3 +1,12 @@
+2005-01-04  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by Hyatt.
+
+       Fixed: <rdar://problem/3936879> nil-deref, crash in InlineFlowBox::nodeAtPoint closing DHTML menus at hrweb.apple.com
+
+        * khtml/rendering/render_block.cpp:
+        (khtml::RenderBlock::fillInlineSelectionGaps): Added a nil check. If there is no selection, don't try to get the selection's containing block. If we do, we'll crash. 
+
 2005-01-04  David Hyatt  <hyatt@apple.com>
 
        Fix for 3937203, force an update of the dashboard regions when scrollbars are added/removed.
index 662111b..79666e4 100644 (file)
@@ -1461,7 +1461,9 @@ GapRects RenderBlock::fillInlineSelectionGaps(RenderBlock* rootBlock, int blockX
     GapRects result;
     
     RenderObject* selStart = canvas()->selectionStart();
-    bool containsStart = (selStart == this) || (selStart->containingBlock() == this);
+    // If there is no selection, don't try to get the selection's containing block. 
+    // If we do, we'll crash.
+    bool containsStart = (selStart && (selStart == this || selStart->containingBlock() == this));
 
     if (!firstLineBox()) {
         if (containsStart) {