# HG changeset patch # User Mikael Berthe # Date 1494087368 -7200 # Node ID 155fdea254c3c19424d9e388ceaa9902e7c652e0 # Parent 7217174c217a42a1f8c89fc414886ea1f77680d5 Do not make an API call if toot has no content diff -r 7217174c217a -r 155fdea254c3 cmd/toot.go --- a/cmd/toot.go Fri May 05 21:55:09 2017 +0000 +++ b/cmd/toot.go Sat May 06 18:16:08 2017 +0200 @@ -82,5 +82,9 @@ } } + if tootText == "" && len(ids) == 0 && opt.spoiler == "" { + return nil, errors.New("toot is empty") + } + return gClient.PostStatus(tootText, opt.inReplyToID, ids, opt.sensitive, opt.spoiler, opt.visibility) }