Closed Bug 1337053 Opened 3 years ago Closed 3 years ago

Fix JSONObject.optString to GeckoBundle.getString conversions

Categories

(GeckoView :: General, defect)

All
Android
defect
Not set

Tracking

(firefox54 fixed)

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: jchen, Assigned: jchen)

References

Details

Attachments

(1 file)

No description provided.
JSONObject.optString defaults to empty string ("") if the key doesn't
exist, whereas GeckoBundle.getString defaults to null if the key doesn't
exist. So the correct conversion for `json.optString("foo")` should be
`bundle.getString("foo", "")`. This patch fixes the wrong conversions
from before. In case we did default to null, this patch gets rid of the
redundant null second argument to GeckoBundle.getString.
Attachment #8834073 - Flags: review?(s.kaspari)
Attachment #8834073 - Flags: review?(s.kaspari) → review+
Pushed by nchen@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/bc5378b6f9aa
Fix optString conversions; r=sebastian
https://hg.mozilla.org/mozilla-central/rev/bc5378b6f9aa
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54
Product: Firefox for Android → GeckoView
Target Milestone: Firefox 54 → mozilla54
You need to log in before you can comment on or make changes to this bug.