Crash less hard if no webcam
This commit is contained in:
parent
00067049ce
commit
955761e0a4
|
@ -56,7 +56,10 @@ func (r *gocvGocvWebcamRenderer) actualrenderframe(w, h int) image.Image {
|
|||
gocvGocvWebcam, _ := gocv.VideoCaptureDevice(int(r.gocvGocvWebcam.GocvWebcamID))
|
||||
img := gocv.NewMat()
|
||||
gocvGocvWebcam.Read(&img)
|
||||
frameImage, _ := img.ToImage() //no point doing anything other than returning anyway!
|
||||
frameImage, err := img.ToImage()
|
||||
if err != nil {
|
||||
frameImage = image.NewRGBA(image.Rect(0, 0, w, h))
|
||||
}
|
||||
return frameImage
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue