tags: fix out of range panic

This commit is contained in:
1l0 2024-10-14 04:25:31 +09:00 committed by fiatjaf_
parent 97ed96ef73
commit 9e744e1eb0

View File

@ -53,7 +53,7 @@ func (tag Tag) Value() string {
}
func (tag Tag) Relay() string {
if (tag[0] == "e" || tag[0] == "p") && len(tag) > 2 {
if len(tag) > 2 && (tag[0] == "e" || tag[0] == "p") {
return NormalizeURL(tag[2])
}
return ""