Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-07-13 19:13:31 -0400
committermkersten2005-07-13 19:13:31 -0400
commit0847bb10f276259c6bafc8db132ec8e7344fd135 (patch)
tree04db3195e31835d96e9b9aecd5d56dfc19c5ec73 /org.eclipse.mylyn.tasks.ui
parente0a39ffeb887c8c5da301d1975315d29cfcc0b34 (diff)
downloadorg.eclipse.mylyn.tasks-0847bb10f276259c6bafc8db132ec8e7344fd135.tar.gz
org.eclipse.mylyn.tasks-0847bb10f276259c6bafc8db132ec8e7344fd135.tar.xz
org.eclipse.mylyn.tasks-0847bb10f276259c6bafc8db132ec8e7344fd135.zip
Fixed NPE
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskList.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java4
2 files changed, 8 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskList.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskList.java
index 785360280..3626a3fee 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskList.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskList.java
@@ -128,8 +128,11 @@ public class TaskList implements Serializable {
int ihandle = 0;
int max = 0;
for (ITask t : tasks) {
- if(t.participatesInTaskHandles()){
- ihandle = Integer.parseInt(t.getHandle().substring(t.getHandle().indexOf('-')+1, t.getHandle().length()));
+ if(t.participatesInTaskHandles()) {
+ String string = t.getHandle().substring(t.getHandle().indexOf('-')+1, t.getHandle().length());
+ if (string != "") {
+ ihandle = Integer.parseInt(string);
+ }
}
max = Math.max(ihandle, max);
ihandle = largestTaskHandleHelper(t.getChildren());
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java
index f07da2bf1..6682be741 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/internal/TaskListExternalizer.java
@@ -60,7 +60,9 @@ public class TaskListExternalizer {
readTaskList(MylarTasksPlugin.getTaskListManager().getTaskList(), MylarTasksPlugin.getTaskListManager().getTaskListFile());
if(MylarTasksPlugin.getDefault().getContributor() != null){
MylarTasksPlugin.getDefault().getContributor().restoreState(TaskListView.getDefault());
- TaskListView.getDefault().getViewer().refresh();
+ if (TaskListView.getDefault() != null) {
+ TaskListView.getDefault().getViewer().refresh();
+ }
}
}

Back to the top