Browse Source

Avoid converting target_id if it's None

pull/10109/head
Rapptz 2 years ago
committed by dolfies
parent
commit
d3655338ef
  1. 5
      discord/audit_logs.py

5
discord/audit_logs.py

@ -661,11 +661,12 @@ class AuditLogEntry(Hashable):
if self.action.target_type is None:
return None
if 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)

Loading…
Cancel
Save