fix: handle donate link error instead of crashing

clicking the donate link on a headless server (or anything without
xdg-open/open) crashes lazydocker because the error from OpenLink
bubbles up unhandled. now it shows an error panel instead, same
pattern openFile already uses three lines below.

tested by swapping OpenLinkCommand to xdg-open on macOS — error
panel renders cleanly instead of crashing.

fixes #437
This commit is contained in:
David Kay 2026-03-21 12:29:56 -05:00
parent 2ebe3848d6
commit 3399570129

View file

@ -423,7 +423,10 @@ func (gui *Gui) handleDonate(g *gocui.Gui, v *gocui.View) error {
if cx > len(gui.Tr.Donate) {
return nil
}
return gui.OSCommand.OpenLink("https://github.com/sponsors/jesseduffield")
if err := gui.OSCommand.OpenLink("https://github.com/sponsors/jesseduffield"); err != nil {
return gui.createErrorPanel(err.Error())
}
return nil
}
func (gui *Gui) editFile(filename string) error {