我的代码抛出NullPointerException

时间:2018-04-04 03:54:09

标签: java android

我的代码在if(encryptedPinBlockKeySerialNumber.length()== 0&& encryptedPinBlock.length()!= 0){中抛出NullPointerException             encryptedPinBlockKeySerialNumber = cksn;         }

public void getDebitParameters (String realAmount, String amountPurchase, String pan, String cardName, String expiryDate, String ctrack1,
                                    String ctrack2, String ctrack3, String cksn, String devID, String emvICCData, Enums.WSAction intAction,
                                    Enums.WSMobileAppTransType transactionType, Enums.WSAccountType accTypeId, String encryptedPinBlock, String encryptedPinBlockKeySerialNumber, boolean fallback ) {


        if (encryptedPinBlockKeySerialNumber.length() == 0 && encryptedPinBlock.length() != 0) {
            encryptedPinBlockKeySerialNumber = cksn;
        }

        try {
            // with (EPB)EncryptedPinBlock
            /* card_action = 1-Swipe, 2-Insert realamount = Double.parseDouble(realAmount);*/
            realamount = realAmount;
            displayamount = amountPurchase;
            cardnum = pan;
            track1 = ctrack1;
            track2 = ctrack2;
            track3 = ctrack3;
            cardHolderName = cardName;
            date = expiryDate;
            ksn = cksn;
            strDevID = devID;
            emvData = emvICCData;
            card_action = intAction;
            mobile_app_trans_type = transactionType;
            account_type = accTypeId;
            epb = encryptedPinBlock;
            epbKsn = encryptedPinBlockKeySerialNumber;
            isfallback = fallback;
        } catch (Exception ex) {
            errorOccured();
        }
    }

0 个答案:

没有答案