silently ignore relayed events after camera removal
authorCalin Crisan <ccrisan@gmail.com>
Fri, 4 Sep 2015 20:46:33 +0000 (23:46 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Fri, 4 Sep 2015 20:46:33 +0000 (23:46 +0300)
motioneye/handlers.py

index 29393e5ec58eef42e9d3aea44c0e45b177c87ea6..9772f2b61bbf24502efe4bac5da5ecad9fc2183a 100644 (file)
@@ -1342,13 +1342,11 @@ class RelayEventHandler(BaseHandler):
         logging.debug('recevied relayed event %(event)s for thread id %(id)s' % {'event': event, 'id': thread_id})
         
         camera_id = motionctl.thread_id_to_camera_id(thread_id)
-        try:
-            camera_config = config.get_camera(camera_id)
-        
-        except:
-            logging.warn('ignoring event for remote camera with id %s (probably removed)' % camera_id)
+        if camera_id is None:
+            logging.debug('ignoring event for thread id %s' % thread_id)
             return self.finish_json()
-
+        
+        camera_config = config.get_camera(camera_id)
         if not utils.local_motion_camera(camera_config):
             logging.warn('ignoring event for non-local camera with id %s' % camera_id)
             return self.finish_json()