mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-15 17:46:55 +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)
|
out := v.(*ClientMessage)
|
||||||
dataStr := string(data)
|
dataStr := string(data)
|
||||||
|
|
||||||
|
if len(dataStr) == 0 {
|
||||||
|
out.MessageID = 0
|
||||||
|
return nil // test: ignore empty frames
|
||||||
|
}
|
||||||
// Message ID
|
// Message ID
|
||||||
spaceIdx = strings.IndexRune(dataStr, ' ')
|
spaceIdx = strings.IndexRune(dataStr, ' ')
|
||||||
if spaceIdx == -1 {
|
if spaceIdx == -1 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue