Skip to content

Commit 4496df7

Browse files
authored
Fix crash in Activity.__init__ with missing keys
not all activity payloads have `state_url` and `details_url` keys present.
1 parent cb7f170 commit 4496df7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

discord/activity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ def __init__(self, **kwargs: Any) -> None:
257257
emoji = kwargs.pop('emoji', None)
258258
self.emoji: Optional[PartialEmoji] = PartialEmoji.from_dict(emoji) if emoji is not None else None
259259

260-
self.state_url: Optional[str] = kwargs.pop('state_url')
261-
self.details_url: Optional[str] = kwargs.pop('details_url')
260+
self.state_url: Optional[str] = kwargs.pop('state_url', None)
261+
self.details_url: Optional[str] = kwargs.pop('details_url', None)
262262

263263
status_display_type = kwargs.pop('status_display_type', None)
264264
self.status_display_type: Optional[StatusDisplayType] = (

0 commit comments

Comments
 (0)