[view] prevent NPE process definitions shouldn't be treated as windows
authorAsier Lostalé <asier.lostale@openbravo.com>
Mon, 06 Aug 2018 09:04:48 +0200
changeset 35068 87f38633756b
parent 35067 bbdf0c84c3e2
child 35069 b3630a7f37c9
[view] prevent NPE process definitions shouldn't be treated as windows
modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java	Mon Aug 06 09:01:48 2018 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java	Mon Aug 06 09:04:48 2018 +0200
@@ -298,7 +298,11 @@
     final String viewId = getParameter("viewId");
     OBContext.setAdminMode();
     try {
-      Window window = adcs.getWindow(correctViewId(viewId));
+      String fixedViewId = correctViewId(viewId);
+      Window window = null;
+      if (!"processDefinition".equals(fixedViewId)) {
+        window = adcs.getWindow(correctViewId(viewId));
+      }
       if (window == null) {
         return "";
       }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java	Mon Aug 06 09:01:48 2018 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java	Mon Aug 06 09:04:48 2018 +0200
@@ -204,10 +204,11 @@
       }
 
       Window window = OBDal.getInstance().get(Window.class, windowId);
-      if (window != null) {
-        for (Tab tab : window.getADTabList()) {
-          initializeTab(tab);
-        }
+      if (window == null) {
+        return;
+      }
+      for (Tab tab : window.getADTabList()) {
+        initializeTab(tab);
       }
 
       synchronized (initializedWindows) {