diff --git a/content/base/src/nsTreeWalker.cpp b/content/base/src/nsTreeWalker.cpp index 5360c7dc005..3228829a853 100644 --- a/content/base/src/nsTreeWalker.cpp +++ b/content/base/src/nsTreeWalker.cpp @@ -147,8 +147,10 @@ NS_IMETHODIMP nsTreeWalker::SetCurrentNode(nsIDOMNode * aCurrentNode) nsresult rv = nsContentUtils::CheckSameOrigin(mRoot, aCurrentNode); NS_ENSURE_SUCCESS(rv, rv); - mCurrentNode = do_QueryInterface(aCurrentNode); + nsCOMPtr node = do_QueryInterface(aCurrentNode); + NS_ENSURE_TRUE(node, NS_ERROR_DOM_NOT_SUPPORTED_ERR); + mCurrentNode.swap(node); return NS_OK; } diff --git a/content/base/test/chrome/Makefile.in b/content/base/test/chrome/Makefile.in index c4bb5f62518..89365034dac 100644 --- a/content/base/test/chrome/Makefile.in +++ b/content/base/test/chrome/Makefile.in @@ -59,6 +59,7 @@ _CHROME_FILES = \ file_bug549682.xul \ test_bug616841.xul \ file_bug616841.xul \ + test_bug635835.xul \ $(NULL) libs:: $(_TEST_FILES) diff --git a/content/base/test/chrome/test_bug635835.xul b/content/base/test/chrome/test_bug635835.xul new file mode 100644 index 00000000000..89f84669add --- /dev/null +++ b/content/base/test/chrome/test_bug635835.xul @@ -0,0 +1,39 @@ + + + + + + + + + + + Mozilla Bug 635835 + + + + +