Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-03-02 16:39:20 -0500
committerspingel2009-03-02 16:39:20 -0500
commitf8534a4a534b35164be9c882d1200d07186fd9f0 (patch)
tree2d4ebab94d3bdc64c11c041c704e3e30aaaeb4a8
parent6e8c84f182ebda660a630a3c8dbd0939e206f125 (diff)
downloadorg.eclipse.mylyn.tasks-f8534a4a534b35164be9c882d1200d07186fd9f0.tar.gz
org.eclipse.mylyn.tasks-f8534a4a534b35164be9c882d1200d07186fd9f0.tar.xz
org.eclipse.mylyn.tasks-f8534a4a534b35164be9c882d1200d07186fd9f0.zip
NEW - bug 266714: NPE when attempting to expand a category
https://bugs.eclipse.org/bugs/show_bug.cgi?id=266714
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskComparator.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskComparator.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskComparator.java
index 5ffd06506..7cd1d5a49 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskComparator.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskComparator.java
@@ -163,7 +163,14 @@ public class TaskComparator implements Comparator<ITask> {
}
private int sortByID(ITask element1, ITask element2, int sortDirection) {
- return sortDirection * (taskKeyComparator.compare2(element1.getTaskKey(), element2.getTaskKey()));
+ String key1 = element1.getTaskKey();
+ String key2 = element2.getTaskKey();
+ if (key1 == null) {
+ return (key2 != null) ? sortDirection : 0;
+ } else if (key2 == null) {
+ return -sortDirection;
+ }
+ return sortDirection * taskKeyComparator.compare2(key1, key2);
}
private int sortByPriority(ITask element1, ITask element2, int sortDirection) {

Back to the top