#vulnerable code 
                                @Override
    public void onEvent(BlockHeaderEvent event, String fromId) {
        if (DistributedBlockInfoRequestUtils.getInstance().addBlockHeader(fromId, event.getEventBody())) {
            return;
        }
        BlockHeader header = event.getEventBody();
        ValidateResult result = header.verify();
        if (result.isFailed()) {
            networkService.removeNode(fromId);
            return;
        }
        blockCacheManager.cacheBlockHeader(header);
        GetSmallBlockEvent getSmallBlockEvent = new GetSmallBlockEvent();
        BasicTypeData<Long> data = new BasicTypeData<>(header.getHeight());
        getSmallBlockEvent.setEventBody(data);
        eventBroadcaster.sendToNode(getSmallBlockEvent, fromId);
    } 
                            #location 8 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Override
    public void onEvent(BlockHeaderEvent event, String fromId) {
        if (DistributedBlockInfoRequestUtils.getInstance().addBlockHeader(fromId, event.getEventBody())) {
            return;
        }
        BlockHeader header = event.getEventBody();
        blockCacheManager.cacheBlockHeader(header);
    }