diff --git a/extensions/webdav/src/nsWebDAVUtils.cpp b/extensions/webdav/src/nsWebDAVUtils.cpp index 3c886748fb1..5e88d6e27b1 100644 --- a/extensions/webdav/src/nsWebDAVUtils.cpp +++ b/extensions/webdav/src/nsWebDAVUtils.cpp @@ -47,6 +47,7 @@ #include "nsIDOMNodeList.h" #include "nsIDOMDocument.h" #include "nsIDOMParser.h" +#include "nsContentErrors.h" #if defined(PR_LOGGING) PRLogModuleInfo *gDAVLog = nsnull; @@ -66,6 +67,10 @@ NS_WD_GetElementByTagName(nsIDOMElement *parentElt, const nsAString &tagName, rv = list->Item(0, getter_AddRefs(node)); NS_ENSURE_SUCCESS(rv, rv); + if (!node) { + return NS_CONTENT_ATTR_NO_VALUE; + } + return CallQueryInterface(node, elt); }