Skip to content

Commit

Permalink
fix target id being None
Browse files Browse the repository at this point in the history
  • Loading branch information
iyad-f committed Dec 29, 2024
1 parent 7db879b commit 243f1f1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions discord/audit_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,14 +799,12 @@ def created_at(self) -> datetime.datetime:

@utils.cached_property
def target(self) -> TargetType:
if self.action.target_type is None:
if self.action.target_type is None or self._target_id is None:
return None

try:
converter = getattr(self, '_convert_target_' + self.action.target_type)
except AttributeError:
if self._target_id is None:
return None
return Object(id=self._target_id)
else:
return converter(self._target_id)
Expand Down

0 comments on commit 243f1f1

Please sign in to comment.