mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-07-07 14:49:56 +02:00
Fix panic in ParseMessage
There is a chance the function can panic if a comma is included in the input which is invalid.
This commit is contained in:
@ -35,6 +35,8 @@ func ParseMessage(message []byte) Envelope {
|
||||
case bytes.Contains(label, []byte("CLOSE")):
|
||||
x := CloseEnvelope("")
|
||||
v = &x
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := v.UnmarshalJSON(message); err != nil {
|
||||
|
Reference in New Issue
Block a user