From c0bfe79bfb59d841618b8ffea19f7e7c47fbb649 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Sun, 12 Jan 2025 13:14:54 +0100 Subject: [PATCH] [Community] handle None product_config.config --- .../supabase_backend/community_supabase_client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/octobot/community/supabase_backend/community_supabase_client.py b/octobot/community/supabase_backend/community_supabase_client.py index a8d17e9d1..ceac74dc0 100644 --- a/octobot/community/supabase_backend/community_supabase_client.py +++ b/octobot/community/supabase_backend/community_supabase_client.py @@ -437,9 +437,10 @@ async def fetch_bot_profile_data(self, bot_config_id: str) -> commons_profiles.P ")" ).eq(enums.BotConfigKeys.ID.value, bot_config_id).execute()).data[0] try: - profile_data = commons_profiles.ProfileData.from_dict( - bot_config["product_config"][enums.ProfileConfigKeys.CONFIG.value] - ) + profile_config = bot_config["product_config"][enums.ProfileConfigKeys.CONFIG.value] + if not profile_config: + raise TypeError(f"product_config.config is '{profile_config}'") + profile_data = commons_profiles.ProfileData.from_dict(profile_config) except (TypeError, KeyError) as err: raise errors.InvalidBotConfigError(f"Missing bot product config: {err} ({err.__class__.__name__})") from err profile_data.profile_details.name = bot_config["product_config"].get("product", {}).get(