Closed Bug 786454 Opened 12 years ago Closed 12 years ago

java.lang.NullPointerException: at org.mozilla.gecko.db.LocalBrowserDB.isReadingListItem(LocalBrowserDB.java)

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
critical

Tracking

(firefox16 affected, firefox17 affected, firefox18 affected)

RESOLVED FIXED
Firefox 19
Tracking Status
firefox16 --- affected
firefox17 --- affected
firefox18 --- affected

People

(Reporter: scoobidiver, Unassigned)

Details

(Keywords: crash, Whiteboard: [native-crash])

Crash Data

Attachments

(1 file)

There are two crashes, one in 16.0a2/20120826, one in 17.0a2/20120828: bp-ab532a22-9011-44f4-8a71-1caa22120828.

java.lang.NullPointerException
	at org.mozilla.gecko.db.LocalBrowserDB.isReadingListItem(LocalBrowserDB.java:427)
	at org.mozilla.gecko.db.BrowserDB.isReadingListItem(BrowserDB.java:146)
	at org.mozilla.gecko.Tab$6.doInBackground(Tab.java:372)
	at org.mozilla.gecko.Tab$6.doInBackground(Tab.java:367)
	at org.mozilla.gecko.util.GeckoAsyncTask$BackgroundTaskRunnable.run(GeckoAsyncTask.java:34)
	at android.os.Handler.handleCallback(Handler.java:615)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:137)
	at org.mozilla.gecko.util.GeckoBackgroundThread.run(GeckoBackgroundThread.java:31)

More reports at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.db.LocalBrowserDB.isReadingListItem%28LocalBrowserDB.java%29
Lucas, this crash is in reading list DB code.
This looks like the same issue we had in bug 765486, but we just fixed that with a null check :/
There are recent crashes in the trunk: bp-ecfe42b9-c3c0-4ec7-b8c5-c48b02121004.
Version: Firefox 17 → Trunk
Ok, I'm taking a pragmatic approach here given that this bug feels very obscure. This patch protects us from the NPE just like the patch for bug 765486 did.
Comment on attachment 681929 [details] [diff] [review]
Protect isReadingListItem against null cursors

A quick look at the ContentResolver.query code shows more than a few reasons to get a null back.
Attachment #681929 - Flags: review?(mark.finkle) → review+
(In reply to Mark Finkle (:mfinkle) from comment #6)
> Comment on attachment 681929 [details] [diff] [review]
> Protect isReadingListItem against null cursors
> 
> A quick look at the ContentResolver.query code shows more than a few reasons
> to get a null back.

Yeah, if the query() call returns a null cursor, this means something really bad happened (which shouldn't be so frequent anyway).
https://hg.mozilla.org/mozilla-central/rev/bb8baf35a273
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 19
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: