[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/khtml
From:       Maks Orlovich <maksim () kde ! org>
Date:       2010-11-10 14:41:42
Message-ID: 20101110144142.95B18AC89E () svn ! kde ! org
[Download RAW message or body]

SVN commit 1195176 by orlovich:

Handle null document here; it's possible in case of some network errors.
Should hopefully fix crash reported by Chani on IRC. 


 M  +6 -4      khtml_ext.cpp  


--- trunk/KDE/kdelibs/khtml/khtml_ext.cpp #1195175:1195176
@@ -1133,8 +1133,9 @@
 {
     KParts::SelectorInterface::Element element;
 
-    // If the specified method is None, return an empty list...
-    if (method == KParts::SelectorInterface::None)
+    // If the specified method is None, return an empty list; similarly
+    // if the document is null, which may be possible in case of an error
+    if (method == KParts::SelectorInterface::None || part()->document().isNull())
         return element;
 
     if (!(supportedQueryMethods() & method))
@@ -1164,8 +1165,9 @@
 {
     QList<KParts::SelectorInterface::Element> elements;
 
-    // If the specified method is None, return an empty list...
-    if (method == KParts::SelectorInterface::None)
+    // If the specified method is None, return an empty list; similarly
+    // if the document is null, which may be possible in case of an error
+    if (method == KParts::SelectorInterface::None || part()->document().isNull())
         return elements;
 
     // If the specified method is not supported, return an empty list...
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic