From fbba483582951b3040a8063aaa086b4f484ae1f1 Mon Sep 17 00:00:00 2001 From: Giga77 <2777446+Giga77@users.noreply.github.com> Date: Sat, 5 Oct 2024 11:24:31 +0200 Subject: [PATCH] Fix issue when data not found --- custom_components/ecole_directe/ecole_directe_helper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/ecole_directe/ecole_directe_helper.py b/custom_components/ecole_directe/ecole_directe_helper.py index 1f464f0..68a5931 100644 --- a/custom_components/ecole_directe/ecole_directe_helper.py +++ b/custom_components/ecole_directe/ecole_directe_helper.py @@ -534,10 +534,10 @@ def get_grade(data): "out_of": data.get("noteSur").replace(".", ","), "default_out_of": data.get("noteSur").replace(".", ","), "grade_out_of": data.get("valeur") + "/" + data.get("noteSur"), - "coefficient": data.get("coef").replace(".", ","), - "class_average": data.get("moyenneClasse").replace(".", ","), - "max": str(data.get("maxClasse")).replace(".", ","), - "min": str(data.get("minClasse")).replace(".", ","), + "coefficient": (data.get("coef") or "").replace(".", ","), + "class_average": (data.get("moyenneClasse") or "").replace(".", ","), + "max": str(data.get("maxClasse") or "").replace(".", ","), + "min": str(data.get("minClasse") or "").replace(".", ","), "is_bonus": "", "is_optionnal": "", "is_out_of_20": "",