mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-27 21:05:53 +00:00
test: Ignore empty frames in Unmarshal()
This commit is contained in:
parent
0744019555
commit
230f4e9ccd
1 changed files with 4 additions and 0 deletions
|
@ -530,6 +530,10 @@ func UnmarshalClientMessage(data []byte, _ int, v interface{}) (err error) {
|
|||
out := v.(*ClientMessage)
|
||||
dataStr := string(data)
|
||||
|
||||
if len(dataStr) == 0 {
|
||||
out.MessageID = 0
|
||||
return nil // test: ignore empty frames
|
||||
}
|
||||
// Message ID
|
||||
spaceIdx = strings.IndexRune(dataStr, ' ')
|
||||
if spaceIdx == -1 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue