From 2cdc20b08ed5b6035a78233335eeaf5b9c1245ea Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Thu, 28 Mar 2019 14:18:01 +0000 Subject: [PATCH] Handle empty or malformed capture list --- openflexure_microscope/camera/base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openflexure_microscope/camera/base.py b/openflexure_microscope/camera/base.py index fcce1a32..db62990e 100644 --- a/openflexure_microscope/camera/base.py +++ b/openflexure_microscope/camera/base.py @@ -251,9 +251,10 @@ class BaseCamera(object): # Create capture object list, and validate captures capture_list = [] - for capture_dict in capture_dict_list: - if 'path' in capture_dict and os.path.isfile(capture_dict['path']): - capture_list.append(capture_from_dict(capture_dict)) + if capture_dict_list: + for capture_dict in capture_dict_list: + if 'path' in capture_dict and os.path.isfile(capture_dict['path']): + capture_list.append(capture_from_dict(capture_dict)) return capture_list