aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Goubet2013-04-15 08:50:26 (EDT)
committerRobin Stocker2013-04-15 09:33:22 (EDT)
commit5d9b2f4cdee96b0d34d9aed5f1000005025348f1 (patch)
tree0e2c79bfc1a28e200b9df155e446ad943b1150c1
parent732735c141dab4db62f9512bc5a02bbf21cbe1cd (diff)
downloadegit-5d9b2f4cdee96b0d34d9aed5f1000005025348f1.zip
egit-5d9b2f4cdee96b0d34d9aed5f1000005025348f1.tar.gz
egit-5d9b2f4cdee96b0d34d9aed5f1000005025348f1.tar.bz2
NPE when right-clicking the synchronize view with no selection.refs/changes/95/11895/2
Change-Id: Ie883783016b66cf2c6ebe5110d5f35cc0f7d2e39 Signed-off-by: Robin Stocker <robin@nibor.org>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitActionContributor.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitActionContributor.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitActionContributor.java
index 3642eed..b28561f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitActionContributor.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitActionContributor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (C) 2011, 2012 Dariusz Luksza <dariusz@luksza.org> and others.
+ * Copyright (C) 2011, 2013 Dariusz Luksza <dariusz@luksza.org> and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -63,6 +63,9 @@ class GitActionContributor extends SynchronizePageActionGroup {
public void fillContextMenu(IMenuManager menu) {
IStructuredSelection selection = (IStructuredSelection) getContext()
.getSelection();
+ if (selection.isEmpty())
+ return;
+
Object element = selection.getFirstElement();
IResource resource = ResourceUtil.getResource(element);
if (resource != null) {