Merge pull request #1328 from ShubhankarKG/dev

Avoid crash in `issue close/reopen` when issue number is invalid
This commit is contained in:
Mislav Marohnić 2020-07-06 14:38:20 +02:00 committed by GitHub
commit cc4c8438fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -709,7 +709,7 @@ func issueClose(cmd *cobra.Command, args []string) error {
if errors.As(err, &idErr) {
return fmt.Errorf("issues disabled for %s", ghrepo.FullName(baseRepo))
} else if err != nil {
return fmt.Errorf("failed to find issue #%d: %w", issue.Number, err)
return err
}
if issue.Closed {
@ -744,7 +744,7 @@ func issueReopen(cmd *cobra.Command, args []string) error {
if errors.As(err, &idErr) {
return fmt.Errorf("issues disabled for %s", ghrepo.FullName(baseRepo))
} else if err != nil {
return fmt.Errorf("failed to find issue #%d: %w", issue.Number, err)
return err
}
if !issue.Closed {