#vulnerable code 
                                @Override
    public void onEvent(TransactionEvent event, String fromId) {
        Transaction tx = event.getEventBody();
        if (null == tx) {
            return;
        }
        ValidateResult result = tx.verify();
        if (result.isFailed()) {
            if (result.getLevel() == SeverityLevelEnum.NORMAL_FOUL) {
                networkService.removeNode(fromId);
            } else if (result.getLevel() == SeverityLevelEnum.FLAGRANT_FOUL) {
                networkService.removeNode(fromId);
            }
        }
        cacheManager.putTx(tx);
    } 
                            #location 8 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Override
    public void onEvent(TransactionEvent event, String fromId) {
        Transaction tx = event.getEventBody();
        if (null == tx) {
            return;
        }
        ValidateResult result = tx.verify();
        if (result.isFailed()) {
            if (result.getLevel() == SeverityLevelEnum.NORMAL_FOUL) {
                networkService.blackNode(fromId,NodePo.YELLOW);
            } else if (result.getLevel() == SeverityLevelEnum.FLAGRANT_FOUL) {
                networkService.blackNode(fromId, NodePo.BLACK);
            }
        }
        cacheManager.putTx(tx);
    }