Bug 676340 - Crash [@ nsAccessible::NativeState() ] (called by nsXULTextFieldAccessible::GetValue), r=tbsaunde
authorAlexander Surkov <surkov.alexander@gmail.com>
Thu, 04 Aug 2011 12:57:31 +0900
changeset 73825 f0075fe638ee78c7c8507dae7cedd62cc4a7119a
parent 73824 0e7f85aa8137ccc923824139ebde10a3c93d72b3
child 73826 5d742d2e4304f8e5052cbd3defc222108ca3a3f1
child 73842 d8a5ef7806ec1d43faea099ce99cab96de8d8d7c
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewerstbsaunde
bugs676340
milestone8.0a1
Bug 676340 - Crash [@ nsAccessible::NativeState() ] (called by nsXULTextFieldAccessible::GetValue), r=tbsaunde
accessible/src/xul/nsXULFormControlAccessible.cpp
--- a/accessible/src/xul/nsXULFormControlAccessible.cpp
+++ b/accessible/src/xul/nsXULFormControlAccessible.cpp
@@ -681,16 +681,19 @@ nsXULTextFieldAccessible::
 
 NS_IMPL_ISUPPORTS_INHERITED3(nsXULTextFieldAccessible, nsAccessible, nsHyperTextAccessible, nsIAccessibleText, nsIAccessibleEditableText)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTextFieldAccessible: nsIAccessible
 
 NS_IMETHODIMP nsXULTextFieldAccessible::GetValue(nsAString& aValue)
 {
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
   PRUint64 state = NativeState();
 
   if (state & states::PROTECTED)    // Don't return password text!
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIDOMXULTextBoxElement> textBox(do_QueryInterface(mContent));
   if (textBox) {
     return textBox->GetValue(aValue);