only call setAnalyticsPref with a valid key, value pair

This commit is contained in:
Ben Wheeler 2020-08-14 13:50:36 -04:00
parent dcd4222b4c
commit 685389bfbd

View file

@ -642,10 +642,11 @@ public class JavaScriptDirectInterface {
JSONArray jsonArray = jsonObject.names();
String key = jsonArray.getString(0);
String value = jsonObject.getString(key);
_activity.setAnalyticsPref(key, value);
} catch (JSONException e) {
Log.e(LOG_TAG, "JSON error: " + e.getMessage(), e);
return;
}
_activity.setAnalyticsPref(key, value);
}
}
}