all repos — searchix @ a2b341d554d9fecc5a4a90eec5438eb1dec2de04

Search engine for NixOS, nix-darwin, home-manager and NUR users

fix: panic rendering corrupted data

Alan Pearce
commit

a2b341d554d9fecc5a4a90eec5438eb1dec2de04

parent

d8620522ba86ee6279d9b190899f7f424a206bec

1 file changed, 18 insertions(+), 1 deletion(-)

changed files
M internal/components/options.gointernal/components/options.go
@@ -26,8 +26,25 @@ if m := convertMatch[nix.Option](hit.Data); m != nil {
return optionRow(hit, *m) } - return nil + return emptyOptionRow(hit) }), + ), + ) +} + +func emptyOptionRow(hit index.DocumentMatch) g.Node { + return Tr( + Td( + g.Text(hit.ID), + ), + Td(Class("description"), + g.Text("No description available"), + Dialog(ID(hit.ID)), + ), + g.If(config.DevMode, + Td(Class("score"), + Score(hit), + ), ), ) }