From 28f2fa1c068c88efeac2c860f5950173e1232698 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 15 Aug 2013 09:30:44 +0800 Subject: [PATCH] IDEMPIERE-528 Determine Zoom window depending on record. Add NPE check. --- .../src/org/compiere/model/MZoomCondition.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/model/MZoomCondition.java b/org.adempiere.base/src/org/compiere/model/MZoomCondition.java index 49f59e75d2..af7beff98b 100644 --- a/org.adempiere.base/src/org/compiere/model/MZoomCondition.java +++ b/org.adempiere.base/src/org/compiere/model/MZoomCondition.java @@ -21,6 +21,7 @@ import java.util.Properties; import org.compiere.util.DB; import org.compiere.util.Env; +import org.compiere.util.Util; /** * Zoom Condition model @@ -102,7 +103,11 @@ public class MZoomCondition extends X_AD_ZoomCondition public static int findZoomWindow(MQuery query) { String tableName = query.getTableName(); + if (Util.isEmpty(tableName)) + return 0; MTable table = MTable.get(Env.getCtx(), tableName); + if (table == null) + return 0; return findZoomWindowByTableId(table.getAD_Table_ID(), query); }