/*******************************************************************************
 *  Copyright (c) 2011 GitHub Inc.
 *  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
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *    Kevin Sawicki (GitHub Inc.) - initial API and implementation
 *******************************************************************************/
package org.eclipse.egit.ui.internal.commit;

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.actions.ActionDelegate;

/**
 * Open commit action
 */
public class OpenCommitAction extends ActionDelegate implements
		IWorkbenchWindowActionDelegate {

	private Shell shell;

	@Override
	public void run(IAction action) {
		CommitSelectionDialog dialog = new CommitSelectionDialog(shell, true);
		if (Window.OK == dialog.open())
			for (Object result : dialog.getResult())
				CommitEditor.openQuiet((RepositoryCommit) result);
	}

	public void init(IWorkbenchWindow window) {
		shell = window.getShell();
	}

}

@@ -1123,17 +1123,17 @@
 ndow.OK 
-=
+!
 = dialog
@@ -1148,28 +1148,36 @@
 %0A%09%09%09
-for (
+return;%0A%09%09
 Object
+%5B%5D
  result
- :
+s =
  dia
@@ -1191,19 +1191,107 @@
 Result()
+;%0A%09%09if (results == null %7C%7C results.length == 0)%0A%09%09%09return;%0A%09%09for (Object result : results
 )%0A
-%09
 %09%09%09Commi

Add check for null/empty results in commit selection dialog.