From 70413f206b98d086d96187020207149bcbc9b5db Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 1 May 2023 14:05:03 +0200 Subject: [PATCH] IDEMPIERE-5703 NPE when importing Physical Inventory using Import CSV button (#1813) * IDEMPIERE-5703 NPE when importing Physical Inventory using Import CSV button * - implement better approach suggested by Heng Sin --- .../org/adempiere/base/callout/CostAdjustmentLineProduct.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org.adempiere.base.callout/src/org/adempiere/base/callout/CostAdjustmentLineProduct.java b/org.adempiere.base.callout/src/org/adempiere/base/callout/CostAdjustmentLineProduct.java index 7be1b4111d..775415e8f7 100644 --- a/org.adempiere.base.callout/src/org/adempiere/base/callout/CostAdjustmentLineProduct.java +++ b/org.adempiere.base.callout/src/org/adempiere/base/callout/CostAdjustmentLineProduct.java @@ -61,6 +61,8 @@ public class CostAdjustmentLineProduct implements IColumnCallout { trxName = gt.get_TrxName(); } } + if (mTab.getValue("M_Inventory_ID") == null) + return null; MInventory inventory = new MInventory(ctx, (Integer) mTab.getValue("M_Inventory_ID"), trxName); if (MDocType.DOCSUBTYPEINV_CostAdjustment.equals(inventory.getC_DocType().getDocSubTypeInv())) { String costingMethod = inventory.getCostingMethod();