From ca3a0784b885bdc3f113e27c0322fc44485946af Mon Sep 17 00:00:00 2001 From: Carlos Quintana <74399022+cquintana92@users.noreply.github.com> Date: Mon, 11 Nov 2024 09:56:23 +0100 Subject: [PATCH] fix: missing null check for dict value (#2316) --- app/api/views/new_custom_alias.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/api/views/new_custom_alias.py b/app/api/views/new_custom_alias.py index 0e21815f..6cb78c2f 100644 --- a/app/api/views/new_custom_alias.py +++ b/app/api/views/new_custom_alias.py @@ -153,7 +153,8 @@ def new_custom_alias_v3(): if not isinstance(data, dict): return jsonify(error="request body does not follow the required format"), 400 - alias_prefix = data.get("alias_prefix", "").strip().lower().replace(" ", "") + alias_prefix_data = data.get("alias_prefix", "") or "" + alias_prefix = alias_prefix_data.strip().lower().replace(" ", "") signed_suffix = data.get("signed_suffix", "") or "" signed_suffix = signed_suffix.strip()