#vulnerable code 
                                @Test
    public void testRun() {
        assertNotNull(blockProcessTask);

        ConsensusStatusContext.setConsensusStatus(ConsensusStatus.WAIT_START);

        blockProcessTask.run();

        assert(!ConsensusStatusContext.isRunning());

        ConsensusDownloadServiceImpl downloadService = SpringLiteContext.getBean(ConsensusDownloadServiceImpl.class);
        downloadService.setDownloadSuccess(true);

        blockProcessTask.run();

        assert(ConsensusStatusContext.isRunning());
    } 
                            #location 12 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Test
    public void testRun() {
        assertNotNull(blockProcessTask);

        if(downloadService.isDownloadSuccess().isSuccess()) {
            downloadService.setDownloadSuccess(false);
        }

        ConsensusStatusContext.setConsensusStatus(ConsensusStatus.WAIT_START);

        blockProcessTask.run();

        assert(!ConsensusStatusContext.isRunning());

        downloadService.setDownloadSuccess(true);

        blockProcessTask.run();

        assert(ConsensusStatusContext.isRunning());
    }