From f2d12b6a26ae87b33b77f81b89fb9cf4c34b6177 Mon Sep 17 00:00:00 2001 From: ayn2op Date: Sat, 11 Jan 2025 12:18:50 -0500 Subject: [PATCH] fix(cmd): check if state is nil (login screen) --- cmd/layout.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/layout.go b/cmd/layout.go index 031150a..12e97e7 100644 --- a/cmd/layout.go +++ b/cmd/layout.go @@ -88,8 +88,10 @@ func (l *Layout) init() { func (l *Layout) onAppInputCapture(event *tcell.EventKey) *tcell.EventKey { switch event.Name() { case l.cfg.Keys.Quit: - if err := discordState.Close(); err != nil { - slog.Error("failed to close the session", "err", err) + if discordState != nil { + if err := discordState.Close(); err != nil { + slog.Error("failed to close the session", "err", err) + } } l.app.Stop()