From a82ba7334662766f5fbd51539efce67d4fc84100 Mon Sep 17 00:00:00 2001 From: Lanre Adelowo Date: Thu, 27 Dec 2018 13:38:38 +0100 Subject: [PATCH] Make sure argsSet verifies string isn't empty too (#4980) --- cmd/cmd.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/cmd.go b/cmd/cmd.go index 1ca885a42b..d246d2599d 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -9,6 +9,7 @@ package cmd import ( "errors" "fmt" + "strings" "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/setting" @@ -22,6 +23,10 @@ func argsSet(c *cli.Context, args ...string) error { if !c.IsSet(a) { return errors.New(a + " is not set") } + + if len(strings.TrimSpace(c.String(a))) == 0 { + return errors.New(a + " is required") + } } return nil }