From 47e462fe55625bdf18e0803db69f759664a781ee Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Tue, 5 May 2026 21:15:00 +0900 Subject: [PATCH] publish: avoid nil panic when --reply decodes to an unexpected type. --- publish.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/publish.go b/publish.go index 9c243ca..cc7ce21 100644 --- a/publish.go +++ b/publish.go @@ -91,6 +91,8 @@ example: replyEvent, _, err = sys.FetchSpecificEvent(ctx, pointer, sdk.FetchSpecificEventParameters{}) case nostr.EntityPointer: replyEvent, _, err = sys.FetchSpecificEvent(ctx, pointer, sdk.FetchSpecificEventParameters{}) + default: + return fmt.Errorf("unexpected reply target type: %T", value) } if err != nil { return fmt.Errorf("failed to fetch reply target event: %w", err)