fix: need to handle no network id

This commit is contained in:
Derrick Hammer 2024-01-07 10:54:26 -05:00
parent a9fb6aedb9
commit 1b8ba683c0
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 12 additions and 1 deletions

View File

@ -71,8 +71,19 @@ func (h *HandshakeOpen) DecodeMessage(dec *msgpack.Decoder) error {
h.handshake = handshake h.handshake = handshake
networkId, err := dec.DecodeString() _, err = dec.PeekCode()
networkId := ""
if err != nil {
if err.Error() != "EOF" {
return err
}
h.networkId = networkId
return nil
}
networkId, err = dec.DecodeString()
if err != nil { if err != nil {
return err return err
} }