Skip to content

Commit

Permalink
check to see if we have a frame before trying to send
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeblackshear committed Jan 2, 2020
1 parent d90e408 commit ab3e70b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frigate/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def run(self):
if new_status != current_object_status[obj_name]:
current_object_status[obj_name] = new_status
self.client.publish(self.topic_prefix+'/'+obj_name, new_status, retain=False)
# send the snapshot over mqtt as well
if not self.best_frames.best_frames[obj_name] is None:
# send the snapshot over mqtt if we have it as well
if obj_name in self.best_frames.best_frames:
ret, jpg = cv2.imencode('.jpg', self.best_frames.best_frames[obj_name])
if ret:
jpg_bytes = jpg.tobytes()
Expand Down

0 comments on commit ab3e70b

Please sign in to comment.