Bug 761086. Throw if someone passes an invalid argument to inDOMUtils::GetCSSStyleRules. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 06 Jun 2012 15:59:57 -0400
changeset 98727 41838b80cb57ca9d9a43e035e2fd4668348c840c
parent 98726 1a2c4e651e306c25b80a7b5801e35ccc58e9ea33
child 98728 35ec6e3cc949cc4a7a833f02e594f54b916aee4e
push id1729
push userlsblakk@mozilla.com
push dateMon, 16 Jul 2012 20:02:43 +0000
treeherdermozilla-aurora@f4e75e148951 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs761086
milestone16.0a1
Bug 761086. Throw if someone passes an invalid argument to inDOMUtils::GetCSSStyleRules. r=smaug
layout/inspector/src/inDOMUtils.cpp
--- a/layout/inspector/src/inDOMUtils.cpp
+++ b/layout/inspector/src/inDOMUtils.cpp
@@ -162,16 +162,17 @@ inDOMUtils::GetCSSStyleRules(nsIDOMEleme
 
   nsCOMPtr<nsIAtom> pseudoElt;
   if (!aPseudo.IsEmpty()) {
     pseudoElt = do_GetAtom(aPseudo);
   }
 
   nsRuleNode* ruleNode = nsnull;
   nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
+  NS_ENSURE_STATE(content);
   nsRefPtr<nsStyleContext> styleContext;
   GetRuleNodeForContent(content, pseudoElt, getter_AddRefs(styleContext), &ruleNode);
   if (!ruleNode) {
     // This can fail for content nodes that are not in the document or
     // if the document they're in doesn't have a presshell.  Bail out.
     return NS_OK;
   }