diff options
author | Alexey Yerin <yyp@disroot.org> | 2021-04-27 19:41:39 +0300 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtz.pm> | 2021-04-27 19:34:42 +0200 |
commit | 73ad4e73949f96a3473cc198ddbed934d35a7283 (patch) | |
tree | 6033dbdcffea1a36fa3e6bc7ad8ab425eaa31676 /commands.go | |
parent | editor: 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.go | 4 |
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 } |