Skip to content

Commit f3534c8

Browse files
committed
Prevent setting empty torrent client path
1 parent b18d11f commit f3534c8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

config.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,13 @@ func configChangeBrowser(ctx *cli.Context) error {
235235
func configChangeTorrent(ctx *cli.Context) error {
236236
cfg := LoadConfig()
237237

238-
cfg.TorrentClientPath = ctx.Args().First()
238+
clientPath := ctx.Args().First()
239+
240+
if clientPath == "" {
241+
return fmt.Errorf("usage: mal cfg torrent <torrent path> <torrent args>")
242+
}
243+
244+
cfg.TorrentClientPath = clientPath
239245
cfg.TorrentClientArgs = ctx.Args().Tail()
240246

241247
cfg.Save()

0 commit comments

Comments
 (0)