Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Fix NPE crash on NamedayDatabaseRefresher#loadSpecialNamedays() #8

Merged
merged 2 commits into from
Sep 2, 2016

Conversation

alexstyl
Copy link
Owner

@alexstyl alexstyl commented Sep 2, 2016

Description

This PR fixes the following crash taken from Crashlytics:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.database.Cursor.moveToNext()' on a null object reference
       at com.alexstyl.specialdates.events.NamedayDatabaseRefresher.loadSpecialNamedays(NamedayDatabaseRefresher.java:132)
       at com.alexstyl.specialdates.events.NamedayDatabaseRefresher.initialiseNamedaysIfEnabled(NamedayDatabaseRefresher.java:73)
       at com.alexstyl.specialdates.events.NamedayDatabaseRefresher.refreshNamedays(NamedayDatabaseRefresher.java:65)
       at com.alexstyl.specialdates.events.PeopleEventsUpdater.updateEventsIfSettingsChanged(PeopleEventsUpdater.java:64)
       at com.alexstyl.specialdates.events.PeopleEventsUpdater.updateEventsIfNeeded(PeopleEventsUpdater.java:45)
       at com.alexstyl.specialdates.events.PeopleEventsContentProvider.refreshEventsIfNeeded(PeopleEventsContentProvider.java:146)
       at com.alexstyl.specialdates.events.PeopleEventsContentProvider.query(PeopleEventsContentProvider.java:48)
       at android.content.ContentProvider.query(ContentProvider.java:978)
       at android.content.ContentProvider$Transport.query(ContentProvider.java:213)
       at android.content.ContentResolver.query(ContentResolver.java:502)
       at android.content.ContentResolver.query(ContentResolver.java:446)
       at com.alexstyl.specialdates.service.PeopleEventsProvider.getCelebrationDateFor(PeopleEventsProvider.java:55)
       at com.alexstyl.specialdates.service.DailyReminderIntentService.onHandleIntent(DailyReminderIntentService.java:63)
       at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:135)
       at android.os.HandlerThread.run(HandlerThread.java:61)

@alexstyl alexstyl merged commit 6e9eb74 into develop Sep 2, 2016
@alexstyl alexstyl deleted the fix_crash branch September 2, 2016 20:02
@alexstyl alexstyl modified the milestone: Simple Analytics 3.7 Sep 4, 2016
alexstyl added a commit that referenced this pull request Jul 4, 2020
Fix NPE crash on NamedayDatabaseRefresher#loadSpecialNamedays()
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant