Skip to content

Commit

Permalink
Never assume fields are non-null in Telegram data...
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Feb 3, 2025
1 parent 66d60e9 commit 1e0a24c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datasources/telegram/search_telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ def map_item(message):
if chat["id"] == channel_id or channel_id is None:
forwarded_username = chat["username"]

elif "_forward" in message and "_chat" in message["_forward"]:
elif message.get("_forward") and message["_forward"].get("_chat"):
if message["_forward"]["_chat"].get("username"):
forwarded_username = message["_forward"]["_chat"]["username"]

Expand Down

0 comments on commit 1e0a24c

Please sign in to comment.