Skip to content

Commit

Permalink
[Community] handle None product_config.config
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Jan 12, 2025
1 parent 9b34aba commit c0bfe79
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c0bfe79

Please sign in to comment.