svn commit: r476790 - /incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r476790 - /incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java

jacopoc
Author: jacopoc
Date: Sun Nov 19 02:30:39 2006
New Revision: 476790

URL: http://svn.apache.org/viewvc?view=rev&rev=476790
Log:
Fixed NPE that could happen for offline credit card authorisations (at least from POS).
Patch from Iain Fogg OFBIZ-477.

Modified:
    incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java

Modified: incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?view=diff&rev=476790&r1=476789&r2=476790
==============================================================================
--- incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java (original)
+++ incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java Sun Nov 19 02:30:39 2006
@@ -1551,7 +1551,7 @@
             String paymentMethodId = orderPaymentPreference.getString("paymentMethodId");
             GenericValue paymentMethod = delegator.findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId));
             GenericValue creditCard = null;
-            if ("CREDIT_CARD".equals(paymentMethod.getString("paymentMethodTypeId"))) {
+            if (paymentMethod != null && "CREDIT_CARD".equals(paymentMethod.getString("paymentMethodTypeId"))) {
                 creditCard = paymentMethod.getRelatedOne("CreditCard");
             }