Fix nullpointer when trying to delete keys or resuming from key import. Uups...

This commit is contained in:
Tobias Erthal
2016-09-10 13:16:29 +02:00
parent d06eae018a
commit d67ffb4fbb
2 changed files with 5 additions and 3 deletions

View File

@@ -120,7 +120,8 @@ public class KeySectionedListAdapter extends SectionCursorAdapter<KeySectionedLi
public long[] getSelectedMasterKeyIds() {
long[] keys = new long[mSelected.size()];
for(int i = 0; i < keys.length; i++) {
if(!moveCursor(mSelected.get(i))) {
int index = getCursorPositionWithoutSections(mSelected.get(i));
if(!moveCursor(index)) {
return keys;
}
@@ -132,7 +133,8 @@ public class KeySectionedListAdapter extends SectionCursorAdapter<KeySectionedLi
public boolean isAnySecretKeySelected() {
for(int i = 0; i < mSelected.size(); i++) {
if(!moveCursor(mSelected.get(i))) {
int index = getCursorPositionWithoutSections(mSelected.get(i));
if(!moveCursor(index)) {
return false;
}

View File

@@ -174,7 +174,7 @@ public class RecyclerFragment<A extends RecyclerView.Adapter> extends Fragment {
@Override
public void onDestroy() {
setAdapter(null);
//setAdapter(null);
super.onDestroy();
}