diff options
| author | Remy Suen | 2010-04-29 00:20:02 +0000 |
|---|---|---|
| committer | Remy Suen | 2010-04-29 00:20:02 +0000 |
| commit | 3f46d0e30fb3c9a35304474a59a016c5f47dda84 (patch) | |
| tree | cfa2ba2907d6479bea4a4d40e59362c0b33ea688 | |
| parent | d47b006c5269bb9427baeec129ed3f8e9b0aaa57 (diff) | |
| download | egit-3f46d0e30fb3c9a35304474a59a016c5f47dda84.tar.gz egit-3f46d0e30fb3c9a35304474a59a016c5f47dda84.tar.xz egit-3f46d0e30fb3c9a35304474a59a016c5f47dda84.zip | |
Fix NPEs being thrown on tree selection in the reset dialog
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.java | 11 |
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 f8ad57263d..686e9d9f55 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); + } } }); |
