#vulnerable code 
                                private void checkCache() {
        if (null == blockService) {
            blockService = NulsContext.getServiceBean(BlockService.class);
        }
        Block block = blockService.getBlock(blockService.getLocalSavedHeight());
        boolean b = (TimeService.currentTimeMillis() - startTime) > 300000;
        b = b && (TimeService.currentTimeMillis() - block.getHeader().getTime()) > 300000;
        if (b) {
            ConsensusManager consensusManager = ConsensusManager.getInstance();
            consensusManager.destroy();
            NulsContext.getInstance().setBestBlock(blockService.getBlock(blockService.getLocalSavedHeight()));
            this.startTime = TimeService.currentTimeMillis();
        }
    } 
                            #location 5 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                private void checkCache() {
//        if (null == blockService) {
//            blockService = NulsContext.getServiceBean(BlockService.class);
//        }
//        Block block = blockService.getBlock(blockService.getLocalSavedHeight());
//        boolean b = (TimeService.currentTimeMillis() - startTime) > 300000;
//        b = b && (TimeService.currentTimeMillis() - block.getHeader().getTime()) > 300000;
//        if (b) {
//            ConsensusManager consensusManager = ConsensusManager.getInstance();
//            consensusManager.destroy();
//            this.startTime = TimeService.currentTimeMillis();
//        }
    }