IDEMPIERE-3703 Performance: Retrieve product from cache in MStorageReservation - fix NPE for charge lines

This commit is contained in:
Carlos Ruiz 2018-05-22 13:26:37 +02:00
parent b38367ee2f
commit caeac16f84
1 changed files with 3 additions and 1 deletions

View File

@ -578,7 +578,9 @@ public class MInOutLine extends X_M_InOutLine
}
}
I_M_AttributeSet attributeset = MProduct.get(getCtx(), getM_Product_ID()).getM_AttributeSet();
I_M_AttributeSet attributeset = null;
if (getM_Product_ID() > 0)
attributeset = MProduct.get(getCtx(), getM_Product_ID()).getM_AttributeSet();
boolean isAutoGenerateLot = false;
if (attributeset != null)
isAutoGenerateLot = attributeset.isAutoGenerateLot();