mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Make sure argsSet verifies string isn't empty too (#4980)
This commit is contained in:
		| @@ -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 | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user