Fix nullpointer when trying to delete keys or resuming from key import. Uups...
This commit is contained in:
@@ -120,7 +120,8 @@ public class KeySectionedListAdapter extends SectionCursorAdapter<KeySectionedLi
|
|||||||
public long[] getSelectedMasterKeyIds() {
|
public long[] getSelectedMasterKeyIds() {
|
||||||
long[] keys = new long[mSelected.size()];
|
long[] keys = new long[mSelected.size()];
|
||||||
for(int i = 0; i < keys.length; i++) {
|
for(int i = 0; i < keys.length; i++) {
|
||||||
if(!moveCursor(mSelected.get(i))) {
|
int index = getCursorPositionWithoutSections(mSelected.get(i));
|
||||||
|
if(!moveCursor(index)) {
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +133,8 @@ public class KeySectionedListAdapter extends SectionCursorAdapter<KeySectionedLi
|
|||||||
|
|
||||||
public boolean isAnySecretKeySelected() {
|
public boolean isAnySecretKeySelected() {
|
||||||
for(int i = 0; i < mSelected.size(); i++) {
|
for(int i = 0; i < mSelected.size(); i++) {
|
||||||
if(!moveCursor(mSelected.get(i))) {
|
int index = getCursorPositionWithoutSections(mSelected.get(i));
|
||||||
|
if(!moveCursor(index)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ public class RecyclerFragment<A extends RecyclerView.Adapter> extends Fragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
setAdapter(null);
|
//setAdapter(null);
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user