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:
Carlos Ruiz 2011-03-26 01:39:19 -05:00
parent d138fb0074
commit f2d0b8d75c
2 changed files with 18 additions and 4 deletions

View File

@ -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

View File

@ -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