Bug 774304 - Check for null pref values when closing MultiChoicePreference. r=mfinkle
authorBrian Nicholson <bnicholson@mozilla.com>
Thu, 18 Oct 2012 12:28:27 -0700
changeset 110700 421315a62cb5e098c01610514d3d368d339fabc0
parent 110699 6bcd2ba50e848b5449b52d14ca183f6a4e3c154f
child 110701 907354856a079b8d6ecc65c8f8cc2f33841b84e9
push id23708
push userryanvm@gmail.com
push dateFri, 19 Oct 2012 01:28:59 +0000
treeherdermozilla-central@fd5556088388 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs774304
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 774304 - Check for null pref values when closing MultiChoicePreference. r=mfinkle
mobile/android/base/MultiChoicePreference.java
--- a/mobile/android/base/MultiChoicePreference.java
+++ b/mobile/android/base/MultiChoicePreference.java
@@ -164,16 +164,22 @@ class MultiChoicePreference extends Dial
                 if (button.isEnabled() != enabled)
                     button.setEnabled(enabled);
             }
         });
     }
 
     @Override
     protected void onDialogClosed(boolean positiveResult) {
+        if (mPrevValues == null || mInitialValues == null) {
+            // Initialization is done asynchronously, so these values may not
+            // have been set before the dialog was closed.
+            return;
+        }
+
         if (!positiveResult) {
             // user cancelled; reset checkbox values to their previous state
             mValues = mPrevValues.clone();
             return;
         } else {
             mPrevValues = mValues.clone();
         }