#fixed code
                                private List<Transaction> getTxList(Block block, List<NulsDigestData> txHashList) {
        List<Transaction> txList = new ArrayList<>();

        for (Transaction tx : block.getTxs()) {
            if (txHashList.contains(tx.getHash())) {
                txList.add(tx);
            }
        }

        if (txList.size() != txHashList.size()) {
            throw new NulsRuntimeException(ErrorCode.DATA_ERROR);
        }
        return txList;
    }
#vulnerable code 
                                private List<Transaction> getTxList(Block block, List<NulsDigestData> txHashList) {
        List<Transaction> txList = new ArrayList<>();
        Map<String, Integer> allTxMap = new HashMap<>();
        for (int i = 0; i < block.getHeader().getTxCount(); i++) {
            Transaction tx = block.getTxs().get(i);
            allTxMap.put(tx.getHash().getDigestHex(), i);
        }
        for (NulsDigestData hash : txHashList) {
            txList.add(block.getTxs().get(allTxMap.get(hash.getDigestHex())));
        }
        if (txList.size() != txHashList.size()) {
            throw new NulsRuntimeException(ErrorCode.DATA_ERROR);
        }
        return txList;
    } 
                            #location 9 
                            #vulnerability type NULL_DEREFERENCE