added length check for args in terminal thread command

This commit is contained in:
omie
2015-05-29 22:59:02 +05:30
parent c7dc57d44f
commit c9acc86601

View File

@ -147,6 +147,9 @@ func threads(client service.Client, args ...string) error {
} }
func thread(client service.Client, args ...string) error { func thread(client service.Client, args ...string) error {
if len(args) == 0 {
return fmt.Errorf("you must specify a thread")
}
tid, err := strconv.Atoi(args[0]) tid, err := strconv.Atoi(args[0])
if err != nil { if err != nil {
return err return err