diff --git a/client/src/org/compiere/apps/AMenuStartItem.java b/client/src/org/compiere/apps/AMenuStartItem.java index 70f32cf84c..3ed1ec8092 100644 --- a/client/src/org/compiere/apps/AMenuStartItem.java +++ b/client/src/org/compiere/apps/AMenuStartItem.java @@ -329,9 +329,13 @@ public class AMenuStartItem extends Thread implements ActionListener } } ff = new FormFrame(); - m_menu.getWindowManager().add(ff); SwingUtilities.invokeLater(m_updatePB); // 1 - ff.openForm(AD_Form_ID); + boolean ok = ff.openForm(AD_Form_ID); + if (!ok) { + ff.dispose(); + return; + } + m_menu.getWindowManager().add(ff); SwingUtilities.invokeLater(m_updatePB); // 2 // Center the window diff --git a/client/src/org/compiere/apps/form/FormFrame.java b/client/src/org/compiere/apps/form/FormFrame.java index 62d61e30ce..3d26cbb210 100644 --- a/client/src/org/compiere/apps/form/FormFrame.java +++ b/client/src/org/compiere/apps/form/FormFrame.java @@ -199,7 +199,7 @@ public class FormFrame extends CFrame { log.config(""); // recursive calls - if (Trace.isCalledFrom("JFrame")) // [x] close window pressed + if (Trace.isCalledFrom("JFrame") && m_panel != null) // [x] close window pressed m_panel.dispose(); m_panel = null; Env.clearWinContext(m_WindowNo);