Fix crash when moving task to end of list

synthesis
Alex Baker 7 years ago
parent 523234c542
commit 308ccfc592

@ -85,12 +85,12 @@ class OrderedMetadataListFragmentHelper {
if (targetTaskId <= 0) {
return; // This can happen with gestures on empty parts of the list (e.g. extra space below tasks)
}
long destinationTaskId = taskAdapter.getTaskId(to);
try {
if(to >= taskAdapter.getCount()) {
updater.moveTo(list, targetTaskId, -1);
} else {
long destinationTaskId = taskAdapter.getTaskId(to);
updater.moveTo(list, targetTaskId, destinationTaskId);
}
} catch (Exception e) {

@ -77,12 +77,12 @@ class AstridOrderedListFragmentHelper {
if (!Task.isValidUuid(targetTaskId)) {
return; // This can happen with gestures on empty parts of the list (e.g. extra space below tasks)
}
String destinationTaskId = taskAdapter.getItemUuid(to);
try {
if(to >= taskAdapter.getCount()) {
updater.moveTo(list, fragment.getFilter(), targetTaskId, "-1"); //$NON-NLS-1$
} else {
String destinationTaskId = taskAdapter.getItemUuid(to);
updater.moveTo(list, fragment.getFilter(), targetTaskId, destinationTaskId);
}
} catch (Exception e) {

Loading…
Cancel
Save