Skip to content

Commit 5e4dd38

Browse files
committed
fix: handle missing ip_address key in request body safely
1 parent 6a54056 commit 5e4dd38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/trigger/handler/impl/task/application_task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def execute(self, trigger_task, **kwargs):
223223
"chat_user_id": chat_user_id,
224224
'chat_user_type': ChatUserType.ANONYMOUS_USER.value,
225225
'application_id': application_id,
226-
'ip_address': kwargs.get('body')['ip_address'],
226+
'ip_address': kwargs.get('body', {}).get('ip_address'),
227227
'source': {
228228
'type': ChatSourceChoices.TRIGGER.value
229229
},

0 commit comments

Comments
 (0)