From 439940677692be2998a937ba47655770ab34fd33 Mon Sep 17 00:00:00 2001 From: jysperm Date: Wed, 16 Jan 2019 11:57:29 +0800 Subject: [PATCH] :bug: Fix `lean switch` panic when no apps available --- commands/switch_action.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commands/switch_action.go b/commands/switch_action.go index 6c6d913a..947cffac 100644 --- a/commands/switch_action.go +++ b/commands/switch_action.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" - "github.com/ahmetalpbalkan/go-linq" "github.com/aisk/logp" "github.com/aisk/wizard" "github.com/fatih/color" @@ -121,7 +120,7 @@ func checkOutWithWizard(regionString string, groupName string) error { case "": loginedRegions := apps.GetLoginedRegions() if len(loginedRegions) == 0 { - + return cli.NewExitError("No apps available in logged regions", 1) } else if len(loginedRegions) == 1 { region = loginedRegions[0] } else {