From 81ed19b7918ede6e7f0b9773265043e3f095b495 Mon Sep 17 00:00:00 2001
From: Loraine Gueguen <loraine.gueguen@sb-roscoff.fr>
Date: Thu, 20 May 2021 21:06:49 +0200
Subject: [PATCH] fix picture_path

---
 utilities.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utilities.py b/utilities.py
index bcee45e..7d4a0b0 100755
--- a/utilities.py
+++ b/utilities.py
@@ -179,7 +179,8 @@ def get_sp_picture(sp_dict_list):
         gspecies = get_gspecies_string_from_sp_dict(sp)
         if gspecies not in sp_picture_dict.keys() or ( constants.ORG_PARAM_DESC_MAIN_SPECIES in sp[constants.ORG_PARAM_DESC].keys() and
                                                            sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_MAIN_SPECIES] == True ):
-            if sp[constants.ORG_PARAM_DESC_PICTURE_PATH] != "":
+            if constants.ORG_PARAM_DESC_PICTURE_PATH in sp[constants.ORG_PARAM_DESC].keys() and \
+                    sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] != "":
                 sp_picture_dict[gspecies] = sp[constants.ORG_PARAM_DESC_PICTURE_PATH]
 
     return sp_picture_dict
-- 
GitLab