From 67b09c0ddd16d3e3cfe1ee24af60a542d2358033 Mon Sep 17 00:00:00 2001 From: rombernier Date: Mon, 6 Nov 2023 15:40:30 +0100 Subject: [PATCH] fix json arg fonction --- CHANGELOG.md | 3 +++ sekoia_automation/action.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d54b543..0efa1a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed + +- Fix json_argument fonction when url arg is empty or None ## [1.6.1] - 2023-11-06 diff --git a/sekoia_automation/action.py b/sekoia_automation/action.py index 254aa14..fe18507 100644 --- a/sekoia_automation/action.py +++ b/sekoia_automation/action.py @@ -139,7 +139,7 @@ def json_argument(self, name: str, arguments: dict, required: bool = True) -> An If `name` is inside arguments, returns the value. If `name`_path is inside arguments, returns the content of the file """ - if name in arguments: + if arguments.get(name, None): self._result_as_file = False return arguments[name] elif f"{name}_path" in arguments: