diff --git a/commands/comment_add.go b/commands/comment_add.go index d720a09ba51c6efabcf70b0c3ea65cd134003b92..5a7cd6a85579bdbfcac532b487e4a14f6125b67c 100644 --- a/commands/comment_add.go +++ b/commands/comment_add.go @@ -21,6 +21,11 @@ func runCommentAdd(cmd *cobra.Command, args []string) error { } defer backend.Close() + b, args, err := _select.ResolveBug(backend, args) + if err != nil { + return err + } + if commentAddMessageFile != "" && commentAddMessage == "" { commentAddMessage, err = input.FromFile(commentAddMessageFile) if err != nil { @@ -39,11 +44,6 @@ func runCommentAdd(cmd *cobra.Command, args []string) error { } } - b, args, err := _select.ResolveBug(backend, args) - if err != nil { - return err - } - err = b.AddComment(commentAddMessage) if err != nil { return err