Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-03-12 02:58:55 -0400
committerspingel2009-03-12 02:58:55 -0400
commit21279fe0ee994f55b9ecd1e6860836066b56aa55 (patch)
treea098a4327af3edc020f93146cb88aeb4251175dc
parentd2a9a88c31d85dd336569d41ed856c05d620ba05 (diff)
downloadorg.eclipse.mylyn.tasks-21279fe0ee994f55b9ecd1e6860836066b56aa55.tar.gz
org.eclipse.mylyn.tasks-21279fe0ee994f55b9ecd1e6860836066b56aa55.tar.xz
org.eclipse.mylyn.tasks-21279fe0ee994f55b9ecd1e6860836066b56aa55.zip
NEW - bug 267915: "Task List Refresh" has encountered an error
https://bugs.eclipse.org/bugs/show_bug.cgi?id=267915
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TreeWalker.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TreeWalker.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TreeWalker.java
index 372ca263b..cb2739144 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TreeWalker.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TreeWalker.java
@@ -60,6 +60,10 @@ public class TreeWalker {
private TreePath getTreePath(TreeItem item) {
List<Object> path = new ArrayList<Object>();
do {
+ // the tree is probably not fully refreshed at this point
+ if (item.getData() == null) {
+ return null;
+ }
path.add(0, item.getData());
item = item.getParentItem();
} while (item != null);
@@ -160,11 +164,14 @@ public class TreeWalker {
TreePath path;
TreeItem parent = item.getParentItem();
if (parent != null) {
- siblings = parent.getItems();
path = getTreePath(parent);
+ if (path == null) {
+ return null;
+ }
+ siblings = parent.getItems();
} else {
- siblings = viewer.getTree().getItems();
path = TreePath.EMPTY;
+ siblings = viewer.getTree().getItems();
}
return visitItems(viewer, path, siblings, item, visitor);
}
@@ -173,7 +180,10 @@ public class TreeWalker {
TreePath path = null;
if (startItem != null) {
if (direction == Direction.DOWN) {
- path = visitChildren(treeViewer, getTreePath(startItem), startItem, visitor);
+ path = getTreePath(startItem);
+ if (path != null) {
+ path = visitChildren(treeViewer, path, startItem, visitor);
+ }
}
if (path == null) {
path = visitSiblings(treeViewer, startItem, visitor);

Back to the top