- fixed <rdar://problem/3631541>: "repro crash in KHTMLPart::setFocusNodeIfNe...
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Apr 2004 10:40:20 +0000 (10:40 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Apr 2004 10:40:20 +0000 (10:40 +0000)
        Reviewed by Maciej.

        * khtml/khtml_part.cpp:
        (KHTMLPart::setFocusNodeIfNeeded):
        added nil check

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

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

index 0c88e87b4ee828bc85b18baf2e669c3e0809d95a..255ec0de2d3ce15da25bdd44868ccc96e9e0b15a 100644 (file)
@@ -1,3 +1,13 @@
+2004-04-23  John Sullivan  <sullivan@apple.com>
+
+        - fixed <rdar://problem/3631541>: "repro crash in KHTMLPart::setFocusNodeIfNeeded"
+
+        Reviewed by Maciej.
+
+        * khtml/khtml_part.cpp:
+        (KHTMLPart::setFocusNodeIfNeeded):
+        added nil check
+
 2004-04-23  Maciej Stachowiak  <mjs@apple.com>
 
         Back out one of the previous changes, it causes a crash. Whoops!
index ea837abbd8e78d30572a6d9c2129a9c50594baa2..c6bae0424512f6b6cf3d0817e944b27e7e34f3d8 100644 (file)
@@ -2545,7 +2545,7 @@ void KHTMLPart::setFocusNodeIfNeeded(const Selection &s)
     NodeImpl *n = s.start().node();
     NodeImpl *target = n->isContentEditable() ? n : 0;
     if (!target) {
-        while (n != s.end().node()) {
+        while (n && n != s.end().node()) {
             if (n->isContentEditable()) {
                 target = n;
                 break;