Fix for crashes reported by users

pull/14/head
Tim Su 15 years ago
parent 6485e8c3a3
commit 12e8c23931

@ -130,9 +130,11 @@ public class GtasksTaskListUpdater {
root.children.add(target);
} else {
Node sibling = findNode(root, moveBeforeTaskId);
int index = sibling.parent.children.indexOf(sibling);
target.parent.children.remove(target);
sibling.parent.children.add(index, target);
if(sibling != null) {
int index = sibling.parent.children.indexOf(sibling);
target.parent.children.remove(target);
sibling.parent.children.add(index, target);
}
}
traverseTreeAndWriteValues(root, new AtomicInteger(0), -1);

@ -38,6 +38,8 @@ public class TimerActionExposer extends BroadcastReceiver {
Task task = PluginServices.getTaskService().fetchById(taskId, Task.ID, Task.TIMER_START,
Task.ELAPSED_SECONDS);
if(task == null)
return;
// was part of a broadcast for actions
if(AstridApiConstants.BROADCAST_REQUEST_ACTIONS.equals(intent.getAction())) {

@ -763,7 +763,8 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
}
public void onQuickActionClicked(QuickActionWidget widget, int position){
mBar.dismiss();
if(mBar != null)
mBar.dismiss();
mBar = null;
if(position == 0) {

@ -95,7 +95,11 @@ public class Astrid2TaskProvider extends ContentProvider {
}
public Astrid2TaskProvider() {
DependencyInjectionService.getInstance().inject(this);
try {
DependencyInjectionService.getInstance().inject(this);
} catch (Exception e) {
// can't do anything about this
}
}
@Override

@ -49,7 +49,11 @@ public class AstridPreferences {
/** CurrentVersion: the currently installed version of Astrid */
public static int getCurrentVersion() {
return Preferences.getInt(P_CURRENT_VERSION, 0);
try {
return Preferences.getInt(P_CURRENT_VERSION, 0);
} catch (Exception e) {
return 0;
}
}
/** CurrentVersion: the currently installed version of Astrid */

Loading…
Cancel
Save