summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/root.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd/root.go b/cmd/root.go
index f288c9f69..f2c42833a 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -123,12 +123,12 @@ to assist developers in writing, debugging, and understanding code directly from
// Cleanup function for when the program exits
cleanup := func() {
- // Shutdown the app
- app.Shutdown()
-
// Cancel subscriptions first
cancelSubs()
+ // Then shutdown the app
+ app.Shutdown()
+
// Then cancel TUI message handler
tuiCancel()
@@ -188,6 +188,10 @@ func setupSubscriber[T any](
defer logging.RecoverPanic(fmt.Sprintf("subscription-%s", name), nil)
subCh := subscriber(ctx)
+ if subCh == nil {
+ logging.Warn("subscription channel is nil", "name", name)
+ return
+ }
for {
select {