From 65a69ee3320b20ac0119d54f1208ed383bfa7dc2 Mon Sep 17 00:00:00 2001 From: hengsin Date: Sun, 16 Jul 2023 21:18:42 +0800 Subject: [PATCH] IDEMPIERE-5725 NPE in gridview on mobile (#1939) --- .../WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java | 2 +- .../WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java index cb8d596533..a1f83b59f6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java @@ -940,7 +940,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value @Override public String getDisplayTextForGridView(Object value) { String s = super.getDisplayTextForGridView(value); - if (ClientInfo.isMobile() && MSysConfig.getBooleanValue(MSysConfig.ZK_GRID_MOBILE_LINE_BREAK_AS_IDENTIFIER_SEPARATOR, true)) { + if (s != null && ClientInfo.isMobile() && MSysConfig.getBooleanValue(MSysConfig.ZK_GRID_MOBILE_LINE_BREAK_AS_IDENTIFIER_SEPARATOR, true)) { String separator = MSysConfig.getValue(MSysConfig.IDENTIFIER_SEPARATOR, null, Env.getAD_Client_ID(Env.getCtx())); if (!Util.isEmpty(separator, true) && s.indexOf(separator) >= 0) { s = s.replace(separator, "\n"); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java index 7f21b9e273..6cfed9276b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java @@ -930,7 +930,7 @@ ContextMenuListener, IZoomableEditor @Override public String getDisplayTextForGridView(Object value) { String s = super.getDisplayTextForGridView(value); - if (ClientInfo.isMobile( )&& MSysConfig.getBooleanValue(MSysConfig.ZK_GRID_MOBILE_LINE_BREAK_AS_IDENTIFIER_SEPARATOR, true)) { + if (s != null && ClientInfo.isMobile( ) && MSysConfig.getBooleanValue(MSysConfig.ZK_GRID_MOBILE_LINE_BREAK_AS_IDENTIFIER_SEPARATOR, true)) { String separator = MSysConfig.getValue(MSysConfig.IDENTIFIER_SEPARATOR, null, Env.getAD_Client_ID(Env.getCtx())); if (!Util.isEmpty(separator, true) && s.indexOf(separator) >= 0) { s = s.replace(separator, "\n");