fix segfault in gh repo rename

This commit is contained in:
satoqz 2024-03-29 14:38:27 +01:00
parent ec812a16f7
commit 176420907b
No known key found for this signature in database

View file

@ -135,7 +135,11 @@ func renameRun(opts *RenameOptions) error {
remote, err := updateRemote(currRepo, newRepo, opts)
if err != nil {
fmt.Fprintf(opts.IO.ErrOut, "%s Warning: unable to update remote %q: %v\n", cs.WarningIcon(), remote.Name, err)
if remote != nil {
fmt.Fprintf(opts.IO.ErrOut, "%s Warning: unable to update remote %q: %v\n", cs.WarningIcon(), remote.Name, err)
} else {
fmt.Fprintf(opts.IO.ErrOut, "%s Warning: unable to update remote: %v\n", cs.WarningIcon(), err)
}
} else if opts.IO.IsStdoutTTY() {
fmt.Fprintf(opts.IO.Out, "%s Updated the %q remote\n", cs.SuccessIcon(), remote.Name)
}