日志输出,空指针导致程序出错-测试获取帧

This commit is contained in:
lijun 2025-01-15 23:48:10 +08:00
parent 647def1279
commit 6a63d53117
1 changed files with 5 additions and 0 deletions

View File

@ -159,6 +159,11 @@ func Get(url string) int {
} }
func GetVideoStream(id int) { func GetVideoStream(id int) {
defer func() {
if err := recover(); err != nil {
log.Printf("设备:%d 错误: %v\n", id, err)
}
}()
is_get, ok := DeviceIsGettingFrame.Load(id) is_get, ok := DeviceIsGettingFrame.Load(id)
if !ok { if !ok {
log.Printf("device: %d not found", id) log.Printf("device: %d not found", id)