From a7fbe304418a8c51f9506d605846a5c78c913ad3 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud <58596990+nmicoud@users.noreply.github.com> Date: Sat, 12 Dec 2020 06:47:06 +0100 Subject: [PATCH] =?UTF-8?q?IDEMPIERE-4584=20:=20InfoProduct=20throws=20"At?= =?UTF-8?q?tempted=20to=20access=20nonexistent=20=E2=80=A6=20(#460)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * IDEMPIERE-4584 : InfoProduct throws "Attempted to access nonexistent ListModelTable field at 2, -1" if no IsInstanceAttribute column * IDEMPIERE-4584 : fix test of column index Co-Authored-By: hengsin <152246+hengsin@users.noreply.github.com> Co-authored-by: hengsin <152246+hengsin@users.noreply.github.com> --- .../adempiere/webui/info/InfoProductWindow.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java index f6d7749972..2398e5593b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java @@ -52,7 +52,7 @@ public class InfoProductWindow extends InfoWindow { /** * */ - private static final long serialVersionUID = -7892916038089331016L; + private static final long serialVersionUID = -640644572459126094L; protected Tabbox tabbedPane; protected WListbox warehouseTbl; @@ -357,11 +357,13 @@ public class InfoProductWindow extends InfoWindow { } } - Object value = contentPanel.getValueAt(row, findColumnIndex("IsInstanceAttribute")); - if (value != null && value.toString().equals("true")) { - m_PAttributeButton.setEnabled(true); - } else { - m_PAttributeButton.setEnabled(false); + m_PAttributeButton.setEnabled(false); + int colIdx = findColumnIndex("IsInstanceAttribute"); + + if (colIdx >= 0) { + Object value = contentPanel.getValueAt(row, colIdx); + if (value != null && value.toString().equals("true")) + m_PAttributeButton.setEnabled(true); } } }