diff --git a/litecord/blueprints/icons.py b/litecord/blueprints/icons.py index 9daa45b..65b8de2 100644 --- a/litecord/blueprints/icons.py +++ b/litecord/blueprints/icons.py @@ -27,7 +27,6 @@ async def send_icon(scope, key, icon_hash, **kwargs): """Send an icon.""" icon = await app.icons.generic_get( scope, key, icon_hash, **kwargs) - if not icon: return '', 404 diff --git a/litecord/images.py b/litecord/images.py index 866955a..d4c1ea9 100644 --- a/litecord/images.py +++ b/litecord/images.py @@ -274,8 +274,6 @@ class IconManager: async def generic_get(self, scope, key, icon_hash, **kwargs) -> Icon: """Get any icon.""" - if icon_hash is None: - return None log.debug('GET {} {} {}', scope, key, icon_hash) key = str(key) diff --git a/litecord/storage.py b/litecord/storage.py index 83f98fc..15b1871 100644 --- a/litecord/storage.py +++ b/litecord/storage.py @@ -604,8 +604,10 @@ class Storage: return [r[0] for r in rows] async def _msg_regex(self, regex, func, content) -> List[Dict]: - res = [] + if content is None: + return [] + res = [] for match in regex.finditer(content): found_id = match.group(1) @@ -763,6 +765,9 @@ class Storage: res['type'] = res['message_type'] res.pop('message_type') + if res['content'] is None: + res['content'] = "" + channel_id = int(row['channel_id']) content = row['content'] guild_id = await self.guild_from_channel(channel_id)