From 639fcca86a88de0afec8a15e51e94ffeb21cdc29 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 17 Jun 2024 13:59:56 +0200 Subject: [PATCH] Fix possible crash of formulas checker --- .../src/printerlinter/linters/formulas.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/printer-linter/src/printerlinter/linters/formulas.py b/printer-linter/src/printerlinter/linters/formulas.py index ad5b7ee943..aa31619678 100644 --- a/printer-linter/src/printerlinter/linters/formulas.py +++ b/printer-linter/src/printerlinter/linters/formulas.py @@ -146,12 +146,13 @@ class Formulas(Linter): available_sections = ["values"] for section in available_sections: - options = config.options(section) - for option in options: - values ={} - values["value"] = config.get(section, option) - overrides[option] = values - file_data["overrides"]= overrides# Process the value here + if config.has_section(section): + options = config.options(section) + for option in options: + values ={} + values["value"] = config.get(section, option) + overrides[option] = values + file_data["overrides"]= overrides# Process the value here return file_data