diff options
author | Simon Garrelou <simon.garrelou@gmail.com> | 2022-12-12 21:44:18 +0100 |
---|---|---|
committer | Simon Garrelou <simon.garrelou@gmail.com> | 2022-12-12 21:44:18 +0100 |
commit | 36d3d71d2b0be149bf2de847c08b37dfd55e24f0 (patch) | |
tree | 60097bb3ace276e93dc62aa72e0558cd01efc3cf /src/page_config.go | |
parent | f1df9f6faef276bb20de0bb6a78873082194c0e2 (diff) | |
download | termsonic-36d3d71d2b0be149bf2de847c08b37dfd55e24f0.tar.gz termsonic-36d3d71d2b0be149bf2de847c08b37dfd55e24f0.zip |
Fix multiple crashes due to nil pointer
Diffstat (limited to 'src/page_config.go')
-rw-r--r-- | src/page_config.go | 5 |
1 files changed, 5 insertions, 0 deletions
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 { | |||
34 | if err != nil { | 34 | if err != nil { |
35 | a.alert("Could not auth: %v", err) | 35 | a.alert("Could not auth: %v", err) |
36 | } else { | 36 | } else { |
37 | a.playQueue.SetClient(a.sub) | ||
37 | a.alert("All good!") | 38 | a.alert("All good!") |
38 | } | 39 | } |
39 | }) | 40 | }) |
40 | 41 | ||
41 | form.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { | 42 | form.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { |
42 | if event.Key() == tcell.KeyCtrlR { | 43 | if event.Key() == tcell.KeyCtrlR { |
44 | if a.sub == nil { | ||
45 | return nil | ||
46 | } | ||
47 | |||
43 | if err := a.refreshArtists(); err != nil { | 48 | if err := a.refreshArtists(); err != nil { |
44 | a.alert("Error: %v", err) | 49 | a.alert("Error: %v", err) |
45 | return nil | 50 | return nil |