Bug 547478 - No errors in workspace, but error symbol occurs in tree

* fix possible IndexOutOfBounds

Change-Id: I1b5316acf52c6ed50eaf4aff20f2114180f58bea
Signed-off-by: Johannes Faltermeier <jfaltermeier@eclipsesource.com>
diff --git a/bundles/org.eclipse.emfforms.swt.treemasterdetail/src/org/eclipse/emfforms/spi/swt/treemasterdetail/diagnostic/DiagnosticCache.java b/bundles/org.eclipse.emfforms.swt.treemasterdetail/src/org/eclipse/emfforms/spi/swt/treemasterdetail/diagnostic/DiagnosticCache.java
index b185ab2..a6ab6b7 100644
--- a/bundles/org.eclipse.emfforms.swt.treemasterdetail/src/org/eclipse/emfforms/spi/swt/treemasterdetail/diagnostic/DiagnosticCache.java
+++ b/bundles/org.eclipse.emfforms.swt.treemasterdetail/src/org/eclipse/emfforms/spi/swt/treemasterdetail/diagnostic/DiagnosticCache.java
@@ -322,11 +322,18 @@
 					if (o1 == o2) {
 						return 0;
 					}
-					return o1.getData().get(0).hashCode() - o2.getData().get(0).hashCode();
+					return getHashCode(o1) - getHashCode(o2);
 				}
 				return -1 * Integer.class.cast(o1.getSeverity()).compareTo(o2.getSeverity());
 			}
 
+			private int getHashCode(Diagnostic o) {
+				if (o.getData().isEmpty()) {
+					return 0;
+				}
+				return o.getData().hashCode();
+			}
+
 		});
 
 		DiagnosticTreeNode(Diagnostic initialValue) {