Skip to content

Commit a82ba73

Browse files
adelowolafriks
authored andcommitted
Make sure argsSet verifies string isn't empty too (#4980)
1 parent 4a685f8 commit a82ba73

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/cmd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package cmd
99
import (
1010
"errors"
1111
"fmt"
12+
"strings"
1213

1314
"code.gitea.io/gitea/models"
1415
"code.gitea.io/gitea/modules/setting"
@@ -22,6 +23,10 @@ func argsSet(c *cli.Context, args ...string) error {
2223
if !c.IsSet(a) {
2324
return errors.New(a + " is not set")
2425
}
26+
27+
if len(strings.TrimSpace(c.String(a))) == 0 {
28+
return errors.New(a + " is required")
29+
}
2530
}
2631
return nil
2732
}

0 commit comments

Comments
 (0)