From 6ba368f7ef6882d8ba5b34bf8653389149a18fbc Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 18 Mar 2009 08:08:14 +0000 Subject: [PATCH] [ 2691102 ] Handle AD_Tab WhereClause context variable parse failure --- base/src/org/compiere/model/GridTable.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/base/src/org/compiere/model/GridTable.java b/base/src/org/compiere/model/GridTable.java index 23fbd8ff7f..17de0078a7 100644 --- a/base/src/org/compiere/model/GridTable.java +++ b/base/src/org/compiere/model/GridTable.java @@ -296,7 +296,18 @@ public class GridTable extends AbstractTableModel if (m_whereClause.indexOf('@') == -1) where.append(m_whereClause); else // replace variables - where.append(Env.parseContext(m_ctx, m_WindowNo, m_whereClause, false)); + { + String context = Env.parseContext(m_ctx, m_WindowNo, m_whereClause, false); + if(context != null && context.length() > 0) + { + where.append(context); + } + else + { + log.log(Level.WARNING, "Failed to parse where clause. whereClause="+m_whereClause); + where.append(" 1 = 2 "); + } + } } if (m_onlyCurrentRows && m_TabNo == 0) {