Skip to content

Commit efa6136

Browse files
committed
added more robust checks to make sure self.object exists
1 parent f015e7f commit efa6136

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

axis-ptz-controller/axis_ptz_controller.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,10 @@ def _track_object(self, time_since_last_update: float) -> None:
658658
self.camera.update_focus(self.object.distance_to_tripod3d)
659659
self.camera.update_pan_tilt_rates(self.rho_dot_c, self.tau_dot_c)
660660

661-
if not self.do_capture:
661+
if self.object is None:
662+
logging.error(f"REALLY not sure why it is None here, but not earlier")
663+
return
664+
if not self.do_capture and self.object is not None:
662665
logging.info(
663666
f"Starting image capture of object: {self.object.object_id}"
664667
)

0 commit comments

Comments
 (0)