fixed bug 26240: NPE when filtering selectors based on datasource
authorAsier Lostalé <asier.lostale@openbravo.com>
Thu, 10 Apr 2014 14:34:14 +0200
changeset 22902 876978a97cfe
parent 22901 d1c9b351823b
child 22903 0c61a782148b
fixed bug 26240: NPE when filtering selectors based on datasource
modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorDataSourceFilter.java
--- a/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorDataSourceFilter.java	Thu Apr 10 14:21:17 2014 +0200
+++ b/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorDataSourceFilter.java	Thu Apr 10 14:34:14 2014 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2013 Openbravo SLU
+ * All portions are Copyright (C) 2010-2014 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -158,6 +158,10 @@
     boolean isCustomQuerySelector = sel.getHQL() != null;
     String filteredCriteria = "";
     String fieldName;
+    if (sel.getTable() == null) {
+      // don't do verifications on selectors not based on tables
+      return;
+    }
     Entity entity = ModelProvider.getInstance().getEntityByTableName(
         sel.getTable().getDBTableName());
     Entity cEntity = null;