From 816f0825ee8da006c31a5412be43189def037431 Mon Sep 17 00:00:00 2001 From: Opher Vishnia Date: Fri, 21 Sep 2018 23:27:51 +0300 Subject: [PATCH] Fix #154 NullPointerException while "Track Release" --- src/gitflow/ui/GitflowBranchChooseDialog.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gitflow/ui/GitflowBranchChooseDialog.java b/src/gitflow/ui/GitflowBranchChooseDialog.java index 14ea8ab..66f3d06 100644 --- a/src/gitflow/ui/GitflowBranchChooseDialog.java +++ b/src/gitflow/ui/GitflowBranchChooseDialog.java @@ -2,6 +2,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; +import com.intellij.openapi.ui.ValidationInfo; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -29,6 +30,16 @@ public GitflowBranchChooseDialog(Project project, List branchNames) { init(); } + @Nullable + @Override + protected ValidationInfo doValidate() { + if (branchList.getSelectedValue() == null){ + return new ValidationInfo("No branch selected!"); + } else { + return null; + } + } + @Nullable @Override protected JComponent createCenterPanel() {