From 407d18a30d74c5fc60e8bd199fb7a4a78127da65 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 9 Apr 2019 05:16:19 -0400 Subject: [PATCH] Fix various bugs with Asset._url None handling. --- discord/asset.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/discord/asset.py b/discord/asset.py index 4e592f678..971a07c34 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