From 36d3d71d2b0be149bf2de847c08b37dfd55e24f0 Mon Sep 17 00:00:00 2001 From: Simon Garrelou Date: Mon, 12 Dec 2022 21:44:18 +0100 Subject: Fix multiple crashes due to nil pointer --- src/page_config.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/page_config.go') diff --git a/src/page_config.go b/src/page_config.go index ed64f58..31e93e4 100644 --- a/src/page_config.go +++ b/src/page_config.go @@ -34,12 +34,17 @@ func (a *app) configPage() *tview.Form { if err != nil { a.alert("Could not auth: %v", err) } else { + a.playQueue.SetClient(a.sub) a.alert("All good!") } }) form.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { if event.Key() == tcell.KeyCtrlR { + if a.sub == nil { + return nil + } + if err := a.refreshArtists(); err != nil { a.alert("Error: %v", err) return nil -- cgit v1.2.3