IDEMPIERE-5759 - Fixed potential NPE when sending a null orderclause (#1880)

This commit is contained in:
Diego Ruiz 2023-06-07 00:32:03 +02:00 committed by GitHub
parent 6c853381a1
commit 5602a15f04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -695,7 +695,7 @@ public class MOrder extends X_C_Order implements DocAction
/************************************************************************** /**************************************************************************
* Get Lines of Order * Get Lines of Order
* @param whereClause where clause or null (starting with AND) * @param whereClause where clause or null (starting with AND)
* @param orderClause order clause * @param orderClause order clause or null
* @return lines * @return lines
*/ */
public MOrderLine[] getLines (String whereClause, String orderClause) public MOrderLine[] getLines (String whereClause, String orderClause)
@ -704,7 +704,7 @@ public class MOrder extends X_C_Order implements DocAction
StringBuilder whereClauseFinal = new StringBuilder(MOrderLine.COLUMNNAME_C_Order_ID+"=? "); StringBuilder whereClauseFinal = new StringBuilder(MOrderLine.COLUMNNAME_C_Order_ID+"=? ");
if (!Util.isEmpty(whereClause, true)) if (!Util.isEmpty(whereClause, true))
whereClauseFinal.append(whereClause); whereClauseFinal.append(whereClause);
if (orderClause.length() == 0) if (Util.isEmpty(orderClause, true))
orderClause = MOrderLine.COLUMNNAME_Line; orderClause = MOrderLine.COLUMNNAME_Line;
// //
List<MOrderLine> list = new Query(getCtx(), I_C_OrderLine.Table_Name, whereClauseFinal.toString(), get_TrxName()) List<MOrderLine> list = new Query(getCtx(), I_C_OrderLine.Table_Name, whereClauseFinal.toString(), get_TrxName())