[352683] AbstractServerAction's run method incorrectly assumes iterator will have elements
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/AbstractServerAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/AbstractServerAction.java
index 1899f54..06fd708 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/AbstractServerAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/AbstractServerAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -53,6 +53,10 @@
public void run() {
Iterator iterator = getStructuredSelection().iterator();
+
+ if (!iterator.hasNext())
+ return;
+
Object obj = iterator.next();
if (obj instanceof IServer) {
IServer server = (IServer) obj;