Fix a problem caused when pushing copy button (swing client) with no record on screen raises this exception:

===========> APanel.actionPerformed: Copy [11]
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.get(ArrayList.java:324)
at org.compiere.model.GridTable.getDataAtRow(GridTable.java:1020)
at org.compiere.model.GridTable.getDataAtRow(GridTable.java:1015)
at org.compiere.model.GridTable.dataNew(GridTable.java:2483)
at org.compiere.model.GridTab.dataNew(GridTab.java:1131)
at org.compiere.apps.APanel.cmd_new(APanel.java:1879)
at org.compiere.apps.APanel.actionPerformed(APanel.java:1690)
This commit is contained in:
Carlos Ruiz 2011-03-08 11:42:27 -05:00
parent 3df5962ed5
commit 780725390a
1 changed files with 2 additions and 0 deletions

View File

@ -1884,6 +1884,8 @@ public final class APanel extends CPanel
else // Don't save else // Don't save
m_curTab.dataIgnore(); m_curTab.dataIgnore();
} }
if (copy && m_curTab.getCurrentRow() < 0)
copy = false;
m_curTab.dataNew (copy); m_curTab.dataNew (copy);
m_curGC.dynamicDisplay(0); m_curGC.dynamicDisplay(0);
// m_curTab.getTableModel().setChanged(false); // m_curTab.getTableModel().setChanged(false);