diff options
author | Laurent Goubet | 2013-04-15 12:50:26 +0000 |
---|---|---|
committer | Robin Stocker | 2013-04-15 13:33:22 +0000 |
commit | 5d9b2f4cdee96b0d34d9aed5f1000005025348f1 (patch) | |
tree | 0e2c79bfc1a28e200b9df155e446ad943b1150c1 /org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal | |
parent | 732735c141dab4db62f9512bc5a02bbf21cbe1cd (diff) | |
download | egit-5d9b2f4cdee96b0d34d9aed5f1000005025348f1.tar.gz egit-5d9b2f4cdee96b0d34d9aed5f1000005025348f1.tar.xz egit-5d9b2f4cdee96b0d34d9aed5f1000005025348f1.zip |
NPE when right-clicking the synchronize view with no selection.
Change-Id: Ie883783016b66cf2c6ebe5110d5f35cc0f7d2e39
Signed-off-by: Robin Stocker <robin@nibor.org>
Diffstat (limited to 'org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal')
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitActionContributor.java | 5 |
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 3642eed3aa..b28561fdf5 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) { |