Fixed None check
This commit is contained in:
		@@ -46,7 +46,7 @@ class ServerRepositoryService(ServerRepositoryABC):
 | 
			
		||||
    def find_server_by_discord_id(self, discord_id: int) -> Optional[Server]:
 | 
			
		||||
        self._logger.trace(__name__, f'Send SQL command: {Server.get_select_by_discord_id_string(discord_id)}')
 | 
			
		||||
        result = self._context.select(Server.get_select_by_discord_id_string(discord_id))
 | 
			
		||||
        if len(result) == 0 or result is None:
 | 
			
		||||
        if result is None or len(result) == 0:
 | 
			
		||||
            return None
 | 
			
		||||
        
 | 
			
		||||
        return Server(
 | 
			
		||||
 
 | 
			
		||||
@@ -55,7 +55,7 @@ class UserRepositoryService(UserRepositoryABC):
 | 
			
		||||
    def find_user_by_discord_id(self, discord_id: int) -> Optional[User]:
 | 
			
		||||
        self._logger.trace(__name__, f'Send SQL command: {User.get_select_by_discord_id_string(discord_id)}')
 | 
			
		||||
        result = self._context.select(User.get_select_by_discord_id_string(discord_id))
 | 
			
		||||
        if len(result) == 0 or result is None:
 | 
			
		||||
        if result is None or len(result) == 0:
 | 
			
		||||
            return None
 | 
			
		||||
        
 | 
			
		||||
        return User(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user