IDEMPIERE-528 Determine Zoom window depending on record. Add NPE check.

This commit is contained in:
Heng Sin Low 2013-08-15 09:30:44 +08:00
parent 77f36b2338
commit 28f2fa1c06
1 changed files with 5 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import java.util.Properties;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Util;
/** /**
* Zoom Condition model * Zoom Condition model
@ -102,7 +103,11 @@ public class MZoomCondition extends X_AD_ZoomCondition
public static int findZoomWindow(MQuery query) public static int findZoomWindow(MQuery query)
{ {
String tableName = query.getTableName(); String tableName = query.getTableName();
if (Util.isEmpty(tableName))
return 0;
MTable table = MTable.get(Env.getCtx(), tableName); MTable table = MTable.get(Env.getCtx(), tableName);
if (table == null)
return 0;
return findZoomWindowByTableId(table.getAD_Table_ID(), query); return findZoomWindowByTableId(table.getAD_Table_ID(), query);
} }