Bug 806192 - Fail instead of segfaulting when not passed nsIContent. r=bz a=lsblakk GECKO170_2012111914_RELBRANCH
authorBenjamin Peterson <benjamin@python.org>
Sat, 17 Nov 2012 21:17:35 -0500
branchGECKO170_2012111914_RELBRANCH
changeset 109876 2e104f2c9b103a7e116cd3f578325d8a9a5f55ea
parent 109873 ed0f6806d1ef3f5c8b5dce1d1e3ee0b1cfa8feb5
child 109877 73e3b3a376a0a0b1e415e199a588b1cd792d0659
push id27
push userbenjamin@python.org
push dateWed, 28 Nov 2012 18:12:57 +0000
reviewersbz, lsblakk
bugs806192
milestone17.0
Bug 806192 - Fail instead of segfaulting when not passed nsIContent. r=bz a=lsblakk
layout/inspector/src/inDOMUtils.cpp
layout/inspector/tests/Makefile.in
--- a/layout/inspector/src/inDOMUtils.cpp
+++ b/layout/inspector/src/inDOMUtils.cpp
@@ -238,17 +238,17 @@ inDOMUtils::GetBindingURLs(nsIDOMElement
 
   *_retval = nullptr;
 
   nsCOMPtr<nsIMutableArray> urls = do_CreateInstance(NS_ARRAY_CONTRACTID);
   if (!urls)
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
-  NS_ASSERTION(content, "elements must implement nsIContent");
+  NS_ENSURE_ARG_POINTER(content);
 
   nsIDocument *ownerDoc = content->OwnerDoc();
   nsXBLBinding *binding = ownerDoc->BindingManager()->GetBinding(content);
 
   while (binding) {
     urls->AppendElement(binding->PrototypeBinding()->BindingURI(), false);
     binding = binding->GetBaseBinding();
   }
--- a/layout/inspector/tests/Makefile.in
+++ b/layout/inspector/tests/Makefile.in
@@ -14,12 +14,13 @@ include $(DEPTH)/config/autoconf.mk
 MOCHITEST_FILES =\
 		test_bug462787.html \
 		test_bug462789.html \
 		test_bug522601.xhtml \
 		test_bug536379.html \
 		test_bug536379-2.html \
 		test_bug557726.html \
 		test_bug609549.xhtml \
+		test_bug806192.html \
 		test_isinheritableproperty.html \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk