空指针导致程序出错
This commit is contained in:
parent
788c40131f
commit
1c581654f4
|
|
@ -166,6 +166,9 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) {
|
|||
img, c := service.GetDeviceCurrentFrame(device_id)
|
||||
if c != count {
|
||||
//将img转[]byte
|
||||
if img.Empty() {
|
||||
fmt.Println("device:%d img is empty!", device_id)
|
||||
} else {
|
||||
buf, _ := gocv.IMEncode(".jpg", img)
|
||||
buf1 := buf.GetBytes()
|
||||
|
||||
|
|
@ -176,6 +179,7 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) {
|
|||
goto end
|
||||
}
|
||||
c = count
|
||||
}
|
||||
} else {
|
||||
//每秒发送一次心跳检测
|
||||
if t_count%10 == 0 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue