summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorRemy Suen2010-04-28 20:20:02 (EDT)
committer Remy Suen2010-04-28 20:20:02 (EDT)
commit3f46d0e30fb3c9a35304474a59a016c5f47dda84 (patch)
treecfa2ba2907d6479bea4a4d40e59362c0b33ea688
parentd47b006c5269bb9427baeec129ed3f8e9b0aaa57 (diff)
downloadegit-3f46d0e30fb3c9a35304474a59a016c5f47dda84.zip
egit-3f46d0e30fb3c9a35304474a59a016c5f47dda84.tar.gz
egit-3f46d0e30fb3c9a35304474a59a016c5f47dda84.tar.bz2
Fix NPEs being thrown on tree selection in the reset dialogrefs/changes/27/627/1
New code was introduced to enable/disable buttons based on the selection in the tree. However, this code did not compensate for the fact that some of those buttons may not have been instantiated if the dialog is being used for a reset operation. Change-Id: I0a61b141acce4d4c778a42467179e190cc67415e
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
index f8ad572..686e9d9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
@@ -114,11 +114,14 @@ public class BranchSelectionDialog extends Dialog {
// TODO add support for checkout of tags
confirmationBtn.setEnabled(oneSelected && branchSelected && !headSelected
&& !tagSelected);
- // we don't support rename on tags
- renameButton.setEnabled(oneSelected && branchSelected && !headSelected && !tagSelected);
- // new branch can not be based on a tag
- newButton.setEnabled(oneSelected && branchSelected && !tagSelected);
+ if (!showResetType) {
+ // we don't support rename on tags
+ renameButton.setEnabled(oneSelected && branchSelected && !headSelected && !tagSelected);
+
+ // new branch can not be based on a tag
+ newButton.setEnabled(oneSelected && branchSelected && !tagSelected);
+ }
}
});