diff --git a/dbPort/src/org/compiere/util/Env.java b/dbPort/src/org/compiere/util/Env.java index 91151ba838..e429948061 100644 --- a/dbPort/src/org/compiere/util/Env.java +++ b/dbPort/src/org/compiere/util/Env.java @@ -98,12 +98,14 @@ public final class Env } **/ //bug [ 1574630 ] - if (!finalCall) { - Container c = s_windows.get(0); - s_windows.clear(); - createWindowNo(c); - } else { - s_windows.clear(); + if (s_windows.size() > 0) { + if (!finalCall) { + Container c = s_windows.get(0); + s_windows.clear(); + createWindowNo(c); + } else { + s_windows.clear(); + } } // Clear all Context