Author: sichen
Date: Mon Jul 31 15:01:16 2006
New Revision: 427319
URL:
http://svn.apache.org/viewvc?rev=427319&view=revLog:
Return false when UtilAccounting is used to check payment or account type of null payments or accounts. Based on patch from Ashish Vijaywargiya. OFBIZ-126
Modified:
incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java
Modified: incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java?rev=427319&r1=427318&r2=427319&view=diff==============================================================================
--- incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java (original)
+++ incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java Mon Jul 31 15:01:16 2006
@@ -129,12 +129,12 @@
/**
- * Checks if a payment is of a specified PaymentType.paymentTypeId. It's better to use the
- * more specific calls like isVendorPrepay().
+ * Checks if a payment is of a specified PaymentType.paymentTypeId. Return false if payment is null. It's better to use the
+ * more specific calls like isTaxPayment().
*/
public static boolean isPaymentType(GenericValue payment, String inputTypeId) throws GenericEntityException {
if (payment == null) {
- throw new GenericEntityException("Cannot check payment type: input payment is null");
+ return false;
}
GenericValue paymentType = payment.getRelatedOneCache("PaymentType");
@@ -184,12 +184,12 @@
}
/**
- * Checks if an account is of a specified GlAccountClass.glAccountClassId. It's better to use the
+ * Checks if an account is of a specified GlAccountClass.glAccountClassId. Returns false if account is null. It's better to use the
* more specific calls like isDebitAccount().
*/
public static boolean isAccountClass(GenericValue account, String inputClassId) throws GenericEntityException {
if (account == null) {
- throw new GenericEntityException("Cannot check account class: input account is null");
+ return false;
}
GenericValue accountClass = account.getRelatedOneCache("GlAccountClass");