jsgoecke/tesla

Stream crashes when an incomplete event is received

jsgoecke opened this issue · 0 comments

2016/06/01 01:29:42 EOF!
2016/06/01 01:29:42 Reconnecting!
2016/06/01 01:29:45 Event -> Id: 27588495-f09e-4ed8-5f0d-7a3f17358513 ShiftState:
2016/06/01 01:30:45 EOF!
2016/06/01 01:30:45 Reconnecting!
panic: runtime error: index out of range

goroutine 148 [running]:
panic(0x82f560, 0xc82000a070)
/usr/local/opt/go/libexec/src/runtime/panic.go:481 +0x3e6
github.com/jsgoecke/tesla.parseStreamEvent(0xc820429e80, 0x1a, 0x1a)
/Users/jgoecke/Dropbox/Development/go/src/github.com/jsgoecke/tesla/stream.go:69 +0x482
github.com/jsgoecke/tesla.readStream(0xc8203be090, 0xc820386ae0)
/Users/jgoecke/Dropbox/Development/go/src/github.com/jsgoecke/tesla/stream.go:57 +0x1af
created by github.com/jsgoecke/tesla.Vehicle.Stream
/Users/jgoecke/Dropbox/Development/go/src/github.com/jsgoecke/tesla/stream.go:44 +0x258