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

Commit 5c72c24b authored by Shufeng Hou's avatar Shufeng Hou Committed by Gerrit - the friendly Code Review server
Browse files

DocumentsUI: Fix NullPointerException in DocumentInfo

Add null pointer check for cursor to avoid crash during stability test.

Change-Id: Ia715345365468f1cb10850d21386c9117885fb23
CRs-Fixed: 927937
parent bfd17284
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -527,10 +527,12 @@ public class DirectoryFragment extends Fragment {
            for (int i = 0; i < size; i++) {
                if (checked.valueAt(i)) {
                    final Cursor cursor = mAdapter.getItem(checked.keyAt(i));
                    if (cursor != null) {
                        final DocumentInfo doc = DocumentInfo.fromDirectoryCursor(cursor);
                        docs.add(doc);
                    }
                }
            }

            final int id = item.getItemId();
            if (id == R.id.menu_open) {