aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhazhismel Kumykov <[email protected]>2016-04-29 15:12:05 -0400
committerKhazhismel Kumykov <[email protected]>2016-04-29 15:13:15 -0400
commit29b01f20baf8a5bd1f73db083ba0f8fb5da687a6 (patch)
treed1ac5260ba01b04245a1787d7d40ee2c59f201b4
parent[commands] Allow role mentions to work with discord.Role params. (diff)
downloaddiscord.py-29b01f20baf8a5bd1f73db083ba0f8fb5da687a6.tar.xz
discord.py-29b01f20baf8a5bd1f73db083ba0f8fb5da687a6.zip
Fix Member.display_name returning None
If Member.nick was None, getattr would happily return None, not the default value.
-rw-r--r--discord/user.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/user.py b/discord/user.py
index ce68775f..c05d9aa1 100644
--- a/discord/user.py
+++ b/discord/user.py
@@ -133,5 +133,5 @@ class User:
if they have a server specific nickname then that
is returned instead.
"""
- return getattr(self, 'nick', self.name)
+ return getattr(self, 'nick', None) or self.name