robmarkcole / HASS-Sighthound

Beta features for Home Assistant Sighthound integration
https://www.home-assistant.io/integrations/sighthound/
MIT License
34 stars 10 forks source link

need to check and exit on None detections #15

Open robmarkcole opened 4 years ago

robmarkcole commented 4 years ago

As reported on forums:

File “/config/custom_components/sighthound/image_processing.py”, line 112, in process_image
self.faces = hound.get_faces(detections)
File “/usr/local/lib/python3.7/site-packages/simplehound/core.py”, line 54, in get_faces
for obj in detections[“objects”]:
TypeError: ‘NoneType’ object is not subscriptable

Caused when detections is None and we are calling get_faces(). We need to check and exit on None detections