From 979c38bdfcc051df214f020b31799ac3e57c5bd4 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 13 Dec 2013 16:28:33 +0800 Subject: [PATCH] 1003572 Problem with Locator field on "Import Inventory" process. --- .../src/org/adempiere/webui/window/WLocatorDialog.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java index 569119a126..b7db1d0f50 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java @@ -43,6 +43,7 @@ import org.adempiere.webui.component.Window; import org.compiere.model.MLocator; import org.compiere.model.MLocatorLookup; import org.compiere.model.MRole; +import org.compiere.util.AdempiereUserError; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; @@ -303,6 +304,9 @@ public class WLocatorDialog extends Window implements EventListener if (log.isLoggable(Level.FINE)) log.fine(m_mLocator.toString()); + if (m_mLocator.getSize()==0 || (m_mLocator.getSize()==1 && m_mLocator.get(m_mLocator.getElementAt(0))==null)) + throw new AdempiereUserError(Msg.getMsg(Env.getCtx(), "DRP-001", false)); + for (int i = 0; i < m_mLocator.getSize(); i++) { Object obj = m_mLocator.getElementAt(i); @@ -552,7 +556,7 @@ public class WLocatorDialog extends Window implements EventListener if (m_change) { ListItem listitem = lstLocator.getSelectedItem(); - MLocator l = (MLocator)listitem.getValue(); + MLocator l = listitem != null ? (MLocator)listitem.getValue() : null; if (l != null) return l.getM_Locator_ID() == m_M_Locator_ID;