Fix bug reported by lovely:
https://sourceforge.net/projects/adempiere/forums/forum/610548/topic/3880506?message=9100474 Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at org.compiere.grid.ed.VPAttribute.actionPerformed(VPAttribute.java:381) When pushing attribute set instance button on Order Receipt & Issue form
This commit is contained in:
parent
d138fb0074
commit
f2d0b8d75c
|
@ -379,8 +379,15 @@ public class VPAttribute extends JComponent
|
|||
Integer oldValue = (Integer)getValue ();
|
||||
int oldValueInt = oldValue == null ? 0 : oldValue.intValue ();
|
||||
int M_AttributeSetInstance_ID = oldValueInt;
|
||||
int M_Product_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, m_GridTab.getTabNo(), "M_Product_ID");
|
||||
int M_ProductBOM_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, m_GridTab.getTabNo(), "M_ProductBOM_ID");
|
||||
int M_Product_ID = 0;
|
||||
int M_ProductBOM_ID = 0;
|
||||
if (m_GridTab != null) {
|
||||
M_Product_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, m_GridTab.getTabNo(), "M_Product_ID");
|
||||
M_ProductBOM_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, m_GridTab.getTabNo(), "M_ProductBOM_ID");
|
||||
} else {
|
||||
M_Product_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, "M_Product_ID");
|
||||
M_ProductBOM_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, "M_ProductBOM_ID");
|
||||
}
|
||||
int M_Locator_ID = -1;
|
||||
|
||||
log.config("M_Product_ID=" + M_Product_ID + "/" + M_ProductBOM_ID
|
||||
|
|
|
@ -162,8 +162,15 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
|
|||
Integer oldValue = (Integer)getValue ();
|
||||
int oldValueInt = oldValue == null ? 0 : oldValue.intValue ();
|
||||
int M_AttributeSetInstance_ID = oldValueInt;
|
||||
int M_Product_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, m_GridTab.getTabNo(), "M_Product_ID");
|
||||
int M_ProductBOM_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, m_GridTab.getTabNo(), "M_ProductBOM_ID");
|
||||
int M_Product_ID = 0;
|
||||
int M_ProductBOM_ID = 0;
|
||||
if (m_GridTab != null) {
|
||||
M_Product_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, m_GridTab.getTabNo(), "M_Product_ID");
|
||||
M_ProductBOM_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, m_GridTab.getTabNo(), "M_ProductBOM_ID");
|
||||
} else {
|
||||
M_Product_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, "M_Product_ID");
|
||||
M_ProductBOM_ID = Env.getContextAsInt (Env.getCtx (), m_WindowNo, "M_ProductBOM_ID");
|
||||
}
|
||||
|
||||
log.config("M_Product_ID=" + M_Product_ID + "/" + M_ProductBOM_ID
|
||||
+ ",M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID
|
||||
|
|
Loading…
Reference in New Issue