Reviewed by John
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Aug 2004 16:45:12 +0000 (16:45 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Aug 2004 16:45:12 +0000 (16:45 +0000)
        Fix for this bug:

        <rdar://problem/3732702> crash in CSSComputedStyleDeclarationImpl running devtools.com editing sample code

        * khtml/khtml_part.cpp:
        (KHTMLPart::selectionComputedStyle): Added a null check.

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/khtml_part.cpp

index c02f17002fd791775d176a2b36ae4423eba0b171..d9ab5b00372905b2aef8a7ab58116b86d15ca7dd 100644 (file)
@@ -1,3 +1,14 @@
+2004-08-11  Ken Kocienda  <kocienda@apple.com>
+
+        Reviewed by John
+
+        Fix for this bug:
+        
+        <rdar://problem/3732702> crash in CSSComputedStyleDeclarationImpl running devtools.com editing sample code
+
+        * khtml/khtml_part.cpp:
+        (KHTMLPart::selectionComputedStyle): Added a null check.
+
 2004-08-10  Darin Adler  <darin@apple.com>
 
         Reviewed by Trey.
index 8091645cf87f7233f416ed623467408fd50f69dc..32b313c79e612d4e2bdf35c5fa2837f92d01e989 100644 (file)
@@ -5407,6 +5407,9 @@ CSSStyleDeclarationImpl *KHTMLPart::selectionComputedStyle(NodeImpl *&nodeToRemo
     Position pos(range.startContainer().handle(), range.startOffset());
     assert(pos.notEmpty());
     ElementImpl *elem = pos.element();
+    if (!elem)
+        return 0;
+    
     ElementImpl *styleElement = elem;
     int exceptionCode = 0;