diff --git a/rdf/content/src/nsXULKeyListener.cpp b/rdf/content/src/nsXULKeyListener.cpp index 289eea146426..99c1c50fa040 100644 --- a/rdf/content/src/nsXULKeyListener.cpp +++ b/rdf/content/src/nsXULKeyListener.cpp @@ -219,6 +219,9 @@ nsresult nsXULKeyListenerImpl::KeyPress(nsIDOMEvent* aKeyEvent) while (keysetNode) { nsString keysetNodeType; nsCOMPtr keysetElement(do_QueryInterface(keysetNode)); + if(!keysetElement) + return rv; + keysetElement->GetNodeName(keysetNodeType); if (keysetNodeType.Equals("keyset")) { // Given the DOM node and Key Event