summaryrefslogtreecommitdiff
path: root/commands.go
diff options
context:
space:
mode:
authorAlexey Yerin <yyp@disroot.org>2021-04-27 19:41:39 +0300
committerHubert Hirtz <hubert@hirtz.pm>2021-04-27 19:34:42 +0200
commit73ad4e73949f96a3473cc198ddbed934d35a7283 (patch)
tree6033dbdcffea1a36fa3e6bc7ad8ab425eaa31676 /commands.go
parenteditor: Ctrl+{Right,Left} moves cursor by words (diff)
Make sure app.s is not nil when issuing quit
Prior to this, when the connection is lost, issuing /quit was causing a segfault.
Diffstat (limited to 'commands.go')
-rw-r--r--commands.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/commands.go b/commands.go
index 6be50ed..fee0571 100644
--- a/commands.go
+++ b/commands.go
@@ -277,7 +277,9 @@ func commandDoQuit(app *App, buffer string, args []string) (err error) {
if 0 < len(args) {
reason = args[0]
}
- app.s.Quit(reason)
+ if app.s != nil {
+ app.s.Quit(reason)
+ }
app.win.Exit()
return
}