Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 912ab78c authored by jangwon.lee's avatar jangwon.lee
Browse files

Before requerying a cursor, check if it is closed.

Before updating a cursor,
it needs to be checked if it is valid.
Currently a defence code only checks
if it is not null.
But in case of "Cursor", it is not valid,
if it is closed.
So just like in CursorAdapter.onContentChanged(),
add the additional defence code to check validation.

Change-Id: I1302f1b6d009897815d4bdb2f20f625688cf9901
parent 9e71310d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -497,7 +497,7 @@ public abstract class CursorTreeAdapter extends BaseExpandableListAdapter implem

            @Override
            public void onChange(boolean selfChange) {
                if (mAutoRequery && mCursor != null) {
                if (mAutoRequery && mCursor != null && !mCursor.isClosed()) {
                    if (false) Log.v("Cursor", "Auto requerying " + mCursor +
                            " due to update");
                    mDataValid = mCursor.requery();