From a3fec6d917ab820b8d3ad4c738ebf5052e32c4bd Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 13 Oct 2024 23:08:00 +0300 Subject: [PATCH] fix nilpointer when ratelimits is nil due to error --- internal/ui/commands.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/ui/commands.go b/internal/ui/commands.go index 15bea28..b4b5458 100644 --- a/internal/ui/commands.go +++ b/internal/ui/commands.go @@ -35,7 +35,12 @@ func enqueueGetReposCmd() tea.Msg { } func getReposCmd(client *github.Client, login string, skipUpstream bool) tea.Cmd { - limits, _, _ := client.RateLimits(context.Background()) + limits, _, err := client.RateLimits(context.Background()) + if err != nil { + return func() tea.Msg { + return errMsg{err} + } + } log.Println("RateLimits: ", limits) if limits.Core.Remaining < 1 { return func() tea.Msg {