mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Avoid converting target_id if it's None
This commit is contained in:
parent
fd9f3e9eff
commit
517d7ae4fe
@ -723,11 +723,12 @@ class AuditLogEntry(Hashable):
|
|||||||
if self.action.target_type is None:
|
if self.action.target_type is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
if self._target_id is None:
|
||||||
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
converter = getattr(self, '_convert_target_' + self.action.target_type)
|
converter = getattr(self, '_convert_target_' + self.action.target_type)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
if self._target_id is None:
|
|
||||||
return None
|
|
||||||
return Object(id=self._target_id)
|
return Object(id=self._target_id)
|
||||||
else:
|
else:
|
||||||
return converter(self._target_id)
|
return converter(self._target_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user