diff options
-rw-r--r-- | ogcp/views.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 7345700..766db70 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -888,8 +888,11 @@ def action_client_info(): for entry in setup: if images and entry['image'] != 0: - image = next(img for img in images if img['id'] == entry['image']) - entry['image'] = image['name'] + image = next((img for img in images if img['id'] == entry['image']), None) + if image: + entry['image'] = image['name'] + else: + entry['image'] = "" else: entry['image'] = "" |