Handle empty or malformed capture list

This commit is contained in:
Joel Collins 2019-03-28 14:18:01 +00:00
parent ebce044fc2
commit 2cdc20b08e

View file

@ -251,6 +251,7 @@ class BaseCamera(object):
# Create capture object list, and validate captures # Create capture object list, and validate captures
capture_list = [] capture_list = []
if capture_dict_list:
for capture_dict in capture_dict_list: for capture_dict in capture_dict_list:
if 'path' in capture_dict and os.path.isfile(capture_dict['path']): if 'path' in capture_dict and os.path.isfile(capture_dict['path']):
capture_list.append(capture_from_dict(capture_dict)) capture_list.append(capture_from_dict(capture_dict))