From 49abb6fb040dab3bbbd4fadb9e548dfd88170014 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 23 Nov 2009 23:30:19 +0000 Subject: [PATCH] Fix a NPE problem found with [2877111] - See identifiers columns when delete records https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2877111&group_id=176962 --- base/src/org/compiere/model/MLookupFactory.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base/src/org/compiere/model/MLookupFactory.java b/base/src/org/compiere/model/MLookupFactory.java index fa63ba8e8d..a24bf99f8e 100644 --- a/base/src/org/compiere/model/MLookupFactory.java +++ b/base/src/org/compiere/model/MLookupFactory.java @@ -848,24 +848,24 @@ public class MLookupFactory // date, number else if (DisplayType.isDate(ldc.DisplayType) || DisplayType.isNumeric(ldc.DisplayType)) { - embedSQL.append(DB.TO_CHAR(TableName + "." + ldc.ColumnName, ldc.DisplayType, language.getAD_Language())); + embedSQL.append("COALESCE(" + DB.TO_CHAR(TableName + "." + ldc.ColumnName, ldc.DisplayType, language.getAD_Language()) + ",'')"); } // TableDir else if ((ldc.DisplayType == DisplayType.TableDir || ldc.DisplayType == DisplayType.Search) && ldc.ColumnName.endsWith("_ID")) { String embeddedSQL = getLookup_TableDirEmbed(language, ldc.ColumnName, TableName); - embedSQL.append("(").append(embeddedSQL).append(")"); + embedSQL.append("COALESCE((").append(embeddedSQL).append("),'')"); } // Table - teo_sarca [ 1714261 ] else if (ldc.DisplayType == DisplayType.Table && ldc.AD_Reference_ID != 0) { String embeddedSQL = getLookup_TableEmbed (language, ldc.ColumnName, TableName, ldc.AD_Reference_ID); - embedSQL.append("(").append(embeddedSQL).append(")"); + embedSQL.append("COALESCE((").append(embeddedSQL).append("),'')"); } // String else - embedSQL.append(TableName).append(".").append(ldc.ColumnName); + embedSQL.append("COALESCE(").append(TableName).append(".").append(ldc.ColumnName).append(",'')"); } embedSQL.append(" FROM ").append(TableName);