diff --git a/org.adempiere.base/src/org/compiere/model/MQuery.java b/org.adempiere.base/src/org/compiere/model/MQuery.java index 7c5702d072..bbb0fde4e3 100644 --- a/org.adempiere.base/src/org/compiere/model/MQuery.java +++ b/org.adempiere.base/src/org/compiere/model/MQuery.java @@ -1112,10 +1112,12 @@ class Restriction implements Serializable boolean virtualColumn = false; if (tableName != null && tableName.length() > 0) { MTable table = MTable.get(Env.getCtx(), tableName); - for (MColumn col : table.getColumns(false)) { - if (ColumnName.equals(col.getColumnSQL())) { - virtualColumn = true; - break; + if (table != null) { + for (MColumn col : table.getColumns(false)) { + if (ColumnName.equals(col.getColumnSQL())) { + virtualColumn = true; + break; + } } } }