From 1c40a3f7cdba1684eb21a4d7109b62eb6ecdbb40 Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Thu, 14 Feb 2008 09:14:33 +0000 Subject: [PATCH] BF [ 1893410 ] NPE when try to open Form Frame w/o class --- client/src/org/compiere/apps/AMenuStartItem.java | 8 ++++++-- client/src/org/compiere/apps/form/FormFrame.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) 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);