IDEMPIERE-4942 Performance Measurement - NPE by opening the Performance Detail Window (#871)

add null check
This commit is contained in:
hengsin 2021-09-14 19:04:02 +08:00 committed by GitHub
parent 992ec3c219
commit 55af0b0db3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -39,6 +39,7 @@ import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.Util;
import org.zkoss.zhtml.A;
import org.zkoss.zhtml.Br;
import org.zkoss.zhtml.Table;
@ -506,12 +507,14 @@ public class WGraph extends Div implements IdSpace {
}
private String stripHtml(String htmlString, boolean all) {
htmlString = htmlString.replace("<html>", "").replace("</html>", "")
.replace("<body>", "").replace("</body>", "").replace("<head>",
"").replace("</head>", "");
if (all)
htmlString = htmlString.replace(">", "&gt;").replace("<", "&lt;");
if (!Util.isEmpty(htmlString, true)) {
htmlString = htmlString.replace("<html>", "").replace("</html>", "")
.replace("<body>", "").replace("</body>", "").replace("<head>",
"").replace("</head>", "");
if (all)
htmlString = htmlString.replace(">", "&gt;").replace("<", "&lt;");
}
return htmlString;
}
} // BarGraph