From 932825080e4bff2a6f6a8acb673387518caf84a4 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Tue, 10 Jun 2025 11:05:08 -0700 Subject: [PATCH] Fix nil check --- nip86.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nip86.go b/nip86.go index 57b5042..099b2d7 100644 --- a/nip86.go +++ b/nip86.go @@ -125,12 +125,13 @@ func (rl *Relay) HandleNIP86(w http.ResponseWriter, r *http.Request) { methods := make([]string, 0, mat.NumField()) for i := 0; i < mat.NumField(); i++ { field := mat.Field(i) + value := mav.Field(i).Interface() // danger: this assumes the struct fields are appropriately named methodName := strings.ToLower(field.Name) // assign this only if the function was defined - if mav.Field(i).Interface() != nil { + if !reflect.ValueOf(value).IsNil() { methods = append(methods, methodName) } }