Bug 1508636 - Guard against setting requestedLocales to null. r=snorp,geckoview-reviewers
authorMatt Brubeck <mbrubeck@mozilla.com>
Tue, 20 Nov 2018 22:38:11 +0000
changeset 503821 2e3fcb9d7d27befc37f3d77d86dcf78553a67c3f
parent 503820 f21e2839396e3057ad8bf44bf473447196c5f9f0
child 503822 38b7a780c50f568065d830971e092742744f103b
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, geckoview-reviewers
bugs1508636
milestone65.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 1508636 - Guard against setting requestedLocales to null. r=snorp,geckoview-reviewers Differential Revision: https://phabricator.services.mozilla.com/D12481
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
@@ -641,16 +641,19 @@ public final class GeckoRuntimeSettings 
      * @param requestedLocales An ordered list of locales in Gecko format ("en-US").
      */
     public void setLocales(String[] requestedLocales) {
         mRequestedLocales = requestedLocales;
         flushLocales();
     }
 
     private void flushLocales() {
+        if (mRequestedLocales == null) {
+            return;
+        }
         final GeckoBundle data = new GeckoBundle(1);
         data.putStringArray("requestedLocales", mRequestedLocales);
         EventDispatcher.getInstance().dispatch("GeckoView:SetLocale", data);
     }
 
     // Sync values with nsICookieService.idl.
     @Retention(RetentionPolicy.SOURCE)
     @IntDef({ COOKIE_ACCEPT_ALL, COOKIE_ACCEPT_FIRST_PARTY,