Bug 429851 - Control for selecting EStructuralFeature on a Domain Model Reference is not working
Added check for empty selection
https://bugs.eclipse.org/bugs/show_bug.cgi?id=429851
diff --git a/bundles/org.eclipse.emf.ecp.ui.view.editor.controls/src/org/eclipse/emf/ecp/view/editor/controls/AbstractFilteredReferenceCommand.java b/bundles/org.eclipse.emf.ecp.ui.view.editor.controls/src/org/eclipse/emf/ecp/view/editor/controls/AbstractFilteredReferenceCommand.java
index 79db722..d4e25c6 100644
--- a/bundles/org.eclipse.emf.ecp.ui.view.editor.controls/src/org/eclipse/emf/ecp/view/editor/controls/AbstractFilteredReferenceCommand.java
+++ b/bundles/org.eclipse.emf.ecp.ui.view.editor.controls/src/org/eclipse/emf/ecp/view/editor/controls/AbstractFilteredReferenceCommand.java
@@ -223,7 +223,10 @@
 

 		public TreePath getTreePath() {

 			if (getTreeViewer() != null) {

-				treePath = ((TreeSelection) getTreeViewer().getSelection()).getPaths()[0];

+				final TreeSelection selection = (TreeSelection) getTreeViewer().getSelection();

+				if (!selection.isEmpty()) {

+					treePath = selection.getPaths()[0];

+				}

 			}

 			return treePath;

 		}