Kagami / go-face

:mag: Face recognition with Go
Creative Commons Zero v1.0 Universal
1.11k stars 169 forks source link

Return early when an error occurs to avoid accessing a nil pointer #62

Closed marianrh closed 3 years ago

marianrh commented 3 years ago

If NewRecognizer returns with an error and rec is nil, accessing rec.ptr later panics. Avoid this by returning early.

Kagami commented 3 years ago

Oops, thanks! Not sure why I missed this PR earlier, sorry.