commit 73ad4e7

Alexey Yerin  ·  2021-04-27 16:41:39 +0000 UTC
parent d12564c
Make sure app.s is not nil when issuing quit

Prior to this, when the connection is lost, issuing /quit was causing a
segfault.
1 files changed,  +3, -1
+3, -1
 1@@ -277,7 +277,9 @@ func commandDoQuit(app *App, buffer string, args []string) (err error) {
 2 	if 0 < len(args) {
 3 		reason = args[0]
 4 	}
 5-	app.s.Quit(reason)
 6+	if app.s != nil {
 7+		app.s.Quit(reason)
 8+	}
 9 	app.win.Exit()
10 	return
11 }