#fixed code
                                @SneakyThrows
    @Override
    public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
        String token = request.getHeader(Constant.TOKEN);
        redisTemplate.delete(Constant.AUTHENTICATION_TOKEN);
        redisTemplate.delete(token);
    }
#vulnerable code 
                                @SneakyThrows
    @Override
    public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
        String token = request.getHeader(Constant.TOKEN);
        redisTemplate.delete(Constant.AUTHENTICATION_TOKEN);
        byte[] authenticationKey = redisTokenStoreSerializationStrategy.serialize(token);
        RedisConnection conn = redisTemplate.getConnectionFactory().getConnection();
        try{
            conn.openPipeline();
            conn.get(authenticationKey);
            conn.del(authenticationKey);
            conn.closePipeline();
        }finally {
            conn.close();
        }
    } 
                            #location 7 
                            #vulnerability type NULL_DEREFERENCE