~taiite/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH senpai] Make sure app.s is not nil when issuing quit

Details
Message ID
<20210427164139.9815-1-yyp@disroot.org>
DKIM signature
pass
Download raw message
Patch: +3 -1
Prior to this, when the connection is lost, issuing /quit was causing a
segfault.
---
 commands.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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
}
-- 
2.31.1
Details
Message ID
<20210427193821.1508c5c7@vroom.localdomain>
In-Reply-To
<20210427164139.9815-1-yyp@disroot.org> (view parent)
DKIM signature
pass
Download raw message
Thank you, pushed both patches!

On Tue, 27 Apr 2021 19:41:39 +0300, Alexey Yerin wrote:
> Prior to this, when the connection is lost, issuing /quit was causing
> a segfault.

Yes, most commands do not handle "app.s" being nil (before senpai
was crashing when connection was lost, because it doesn't fetch history
on reconnect anyway, though there is an issue for that in the issue
tracker).
Reply to thread Export thread (mbox)