Bug 433914 - Tabbed Properties View (TabbedPropertyList) throws NPE

This eliminates the single case where elements is null and hopefully fix
the reported NPE.
It was only null on initialization and before elements were set the
first time. There was no way (not even removing all elements) to made
the array null again and basically the entire class is based on
elements.length without null checks.

Change-Id: Ib3088fe6a033d1c1c1ef4bea3096281f0d89c687
Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
diff --git a/bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java b/bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java
index 698e3dd..29cac96 100755
--- a/bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java
+++ b/bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java
@@ -69,7 +69,7 @@
 
 	private boolean focus = false;
 
-	private ListElement[] elements;
+	private ListElement[] elements = ELEMENTS_EMPTY;
 
 	/**
 	 * This map specifies the number of dynamic images for a tab. It has a
@@ -710,10 +710,8 @@
 	 * Removes all elements from this list.
 	 */
 	public void removeAll() {
-		if (elements != null) {
-			for (ListElement element : elements) {
-				element.dispose();
-			}
+		for (ListElement element : elements) {
+			element.dispose();
 		}
 		elements = ELEMENTS_EMPTY;
 		selectedElementIndex = NONE;