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 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...