diff --git a/discordgsm/database.py b/discordgsm/database.py index 2cd5ae5..6f3fc51 100644 --- a/discordgsm/database.py +++ b/discordgsm/database.py @@ -531,8 +531,11 @@ def update_servers_style_data(self, servers: list[Server]): def __update_servers_channel_id(self, servers: list[Server], channel_id: int): if self.driver == Driver.MongoDB: - max_position = self.collection.find_one({'channel_id': channel_id}, sort=[ - ('position', -1)])["position"] + try: + max_position = self.collection.find_one({'channel_id': channel_id}, sort=[ + ('position', -1)])["position"] + except TypeError: + max_position = 0 operations = []