diff options
author | delthas <delthas@dille.cc> | 2021-07-14 22:33:17 +0200 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtz.pm> | 2021-07-15 09:21:55 +0200 |
commit | b6e7fbf2e3e177ed8f9474152ed1cc419ecaf8b6 (patch) | |
tree | 6c0e72dd0df48f09bab96710204426b5a3f46e2b /app.go | |
parent | Make buffers indexed, and refer to indexes with /BUFFER (diff) |
Fix crash on disconnect
The crash was due to accessing app.s.Nick() when app.s was nil.
This is a good opportunity to print a special prompt when disconnected:
I chose `<offline>`, in red.
Diffstat (limited to 'app.go')
-rw-r--r-- | app.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -811,6 +811,12 @@ func (app *App) updatePrompt() { StyleDefault. Foreground(tcell.Color(app.cfg.Colors.Prompt)), ) + } else if app.s == nil { + prompt = ui.Styled("<offline>", + tcell. + StyleDefault. + Foreground(tcell.ColorRed), + ) } else { prompt = identString(app.s.Nick()) } |