all repos — searchix @ 5a2d54d9c8751935284293b2ffd396fff0a5d202

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

fix: panic rendering search results
Alan Pearce alan@alanpearce.eu
Thu, 11 Jul 2024 22:33:50 +0200
commit

5a2d54d9c8751935284293b2ffd396fff0a5d202

parent

94b21b286edff37496a2fe481963625ac01c30a1

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M internal/components/results.templinternal/components/results.templ
@@ -6,7 +6,10 @@ "go.alanpearce.eu/searchix/internal/nix" )
 
 func convertMatch[I nix.Importable](m nix.Importable) *I {
-	i := m.(I)
+	i, ok := m.(I)
+	if !ok {
+		return nil
+	}
 	return &i
 }