Bug 182657 AssertionFailedException running Ant UI test suite
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
index b0aa497..798c8fc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
@@ -334,9 +334,9 @@
 		for (int i = 0; i < items.length; i++) {
 			buildViewerState(EMPTY_TREE_PATH, delta, items[i], set, i);
 		}
-		// add memento for top item
+		// add memento for top item if it is mapped to an element
 		TreeItem topItem = tree.getTopItem();
-		if (topItem != null) {
+		if (topItem != null && topItem.getData() != null) {
 			TreePath path = ((InternalTreeModelViewer)getTreeViewer()).getTreePathFromItem(topItem);
 			ModelDelta parentDelta = delta;
 			for (int i = 0; i < path.getSegmentCount(); i++) {