Skip to content

Commit

Permalink
Fixing NPE during selection of synced calendars.
Browse files Browse the repository at this point in the history
If the connection is slow, and the accounts cursor has not finished
the query before onStop() of SelectSyncedCalendarsMultiAccountActivity
is called, we can have a NPE on the accounts cursor.

Bug: 7742419
Change-Id: I48f4b7ce0236a63c5b5c0e9665dad90c5a8d21da
  • Loading branch information
Sam Blitzstein committed Dec 14, 2012
1 parent f9fa0ab commit 6f67927
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -110,7 +110,7 @@ protected void onPause() {
protected void onStop() {
super.onStop();
mAdapter.closeChildrenCursors();
if (!mAccountsCursor.isClosed()) {
if (mAccountsCursor != null && !mAccountsCursor.isClosed()) {
mAccountsCursor.close();
}
}
Expand Down

0 comments on commit 6f67927

Please sign in to comment.