aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-04-09 05:16:19 -0400
committerRapptz <[email protected]>2019-04-09 05:17:29 -0400
commit407d18a30d74c5fc60e8bd199fb7a4a78127da65 (patch)
treed227c8dba323c7b19183df574a38530eb264be85
parentFix cleanup code on Linux not working properly. (diff)
downloaddiscord.py-407d18a30d74c5fc60e8bd199fb7a4a78127da65.tar.xz
discord.py-407d18a30d74c5fc60e8bd199fb7a4a78127da65.zip
Fix various bugs with Asset._url None handling.
-rw-r--r--discord/asset.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/discord/asset.py b/discord/asset.py
index 4e592f67..971a07c3 100644
--- a/discord/asset.py
+++ b/discord/asset.py
@@ -96,10 +96,12 @@ class Asset:
return cls(state, url.format(id, hash, format, size, key=key))
def __str__(self):
- return self._url
+ return self._url if self._url is not None else ''
def __len__(self):
- return len(self._url)
+ if self._url:
+ return len(self._url)
+ return 0
def __bool__(self):
return self._url is not None