Prevent crash if telegram message failed and did not generate an ID (#137989)

Fix #137901 - Regression introduced in 6fdccda2256f92c824a98712ef102b4a77140126
This commit is contained in:
Daniel O'Connor 2025-02-10 20:17:02 +10:30 committed by GitHub
parent 8c602d74f3
commit 38b8df8f6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -756,7 +756,8 @@ class TelegramNotificationService:
message_thread_id=params[ATTR_MESSAGE_THREAD_ID],
context=context,
)
msg_ids[chat_id] = msg.id
if msg is not None:
msg_ids[chat_id] = msg.id
return msg_ids
async def delete_message(self, chat_id=None, context=None, **kwargs):