Closed Bug 768900 Opened 13 years ago Closed 13 years ago

java.lang.NullPointerException: at org.mozilla.gecko.AndroidImport.mergeBookmarks(AndroidImport.java)

Categories

(Firefox for Android Graveyard :: General, defect)

16 Branch
ARM
Android
defect
Not set
critical

Tracking

(firefox15 verified, firefox16 verified, firefox17 verified)

VERIFIED FIXED
Firefox 16
Tracking Status
firefox15 --- verified
firefox16 --- verified
firefox17 --- verified

People

(Reporter: scoobidiver, Assigned: gcp)

References

Details

(Keywords: crash, regression)

Crash Data

Attachments

(1 file)

It first appeared in 16.0a1/20120626092318 (not an official nightly build). See bp-7669c265-7f1d-4124-989c-17c432120627. The regression window might be (low volume): http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=c659521a7a9a&tochange=5cdbeae14405 It's likely a regression from bug 710330. java.lang.NullPointerException at org.mozilla.gecko.AndroidImport.mergeBookmarks(AndroidImport.java:59) at org.mozilla.gecko.AndroidImport.run(AndroidImport.java:142) at org.mozilla.gecko.AndroidImportPreference$2.run(AndroidImportPreference.java:71) at android.os.Handler.handleCallback(Handler.java:605) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at org.mozilla.gecko.GeckoBackgroundThread.run(GeckoBackgroundThread.java:31) More reports at: https://crash-stats.mozilla.com/report/list?signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.AndroidImport.mergeBookmarks%28AndroidImport.java%29
Assignee: nobody → gpascutto
final int faviconCol = cursor.getColumnIndexOrThrow(Browser.BookmarkColumns.FAVICON); FAVICON is API level 1, so this probably happens if the user has no actual bookmarks, though I think the column is still supposed to exist in the projection. Maybe this happens if the user has no bookmarks, the database itself isn't even created. Easy to fix but a bit of a strange bug IMHO.
STR: i) disable com.google.android.browser ii) attempt to import history/bookmarks
(In reply to Aaron Train [:aaronmt] from comment #3) > STR: i) disable com.google.android.browser ii) attempt to import > history/bookmarks Hmm, in this case the returned cursor is probably null, not simply pointing to an empty result set. I guess doing a null check on the cursor in this specific case makes sense.
Not sure if the try/finally is really needed, but in another bug I ran into the problem that some Android versions have bugs that "forget" to create random bookmarks columns, so let's not crash our app if that is the case.
Attachment #637911 - Flags: review?(mark.finkle)
Comment on attachment 637911 [details] [diff] [review] Patch 1. Check for null and catch errors Seems OK, just move the "cursor" declaration out of the try blocks and fix the ";" on it's own line issue.
Attachment #637911 - Flags: review?(mark.finkle) → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 16
Blocks: 769216
Comment on attachment 637911 [details] [diff] [review] Patch 1. Check for null and catch errors [Approval Request Comment] Bug caused by (feature/regressing bug #): bug 710330 User impact if declined: App will crash if the user tries to import from the Android Browser while that Browser is disabled in the OS. Testing completed (on m-c, etc.): Landed a few days ago in m-c. Risk to taking this patch (and alternatives if risky): Very low.
Attachment #637911 - Flags: approval-mozilla-aurora?
Attachment #637911 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: