diff options
author | Lanre Adelowo <adelowomailbox@gmail.com> | 2018-12-27 13:38:38 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-12-27 14:38:38 +0200 |
commit | a82ba7334662766f5fbd51539efce67d4fc84100 (patch) | |
tree | 27bdf62eca277e39c770d658bc62b0621ce89353 /cmd/cmd.go | |
parent | 4a685f8b872a3d4c101c5e8165fa99e696c8fb45 (diff) | |
download | gitea-a82ba7334662766f5fbd51539efce67d4fc84100.tar.gz gitea-a82ba7334662766f5fbd51539efce67d4fc84100.zip |
Make sure argsSet verifies string isn't empty too (#4980)
Diffstat (limited to 'cmd/cmd.go')
-rw-r--r-- | cmd/cmd.go | 5 |
1 files changed, 5 insertions, 0 deletions
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 } |