package gitflow.ui;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.util.List;

/**
 *  Dialog for choosing branches
 *
 * @author Opher Vishnia / opherv.com / opherv@gmail.com
 */

public class GitflowBranchChooseDialog extends DialogWrapper {
    private JPanel contentPane;
    private JList branchList;


    public GitflowBranchChooseDialog(Project project, List<String> branchNames) {
        super(project, true);

        setModal(true);

        setTitle("Choose Branch");
        branchList.setListData(branchNames.toArray());

        init();
    }

    @Nullable
    @Override
    protected JComponent createCenterPanel() {
        return contentPane;
    }

    public String getSelectedBranchName(){
        return branchList.getSelectedValue().toString();
    }
}

@@ -105,16 +105,63 @@
 rapper;%0A
+import com.intellij.openapi.ui.ValidationInfo;%0A
 import o
@@ -719,24 +719,268 @@
 t();%0A    %7D%0A%0A
+    @Nullable%0A    @Override%0A    protected ValidationInfo doValidate() %7B%0A        if (branchList.getSelectedValue() == null)%7B%0A           return new ValidationInfo(%22No branch selected!%22);%0A        %7D else %7B%0A            return null;%0A        %7D%0A    %7D%0A%0A
     @Nullabl

Fix #154 NullPointerException while "Track Release"