From 336017f61bb70d9a523c5f10226ca66e181db454 Mon Sep 17 00:00:00 2001 From: shuyangzhou Date: Fri, 3 Dec 2021 09:27:20 -0800 Subject: [PATCH] Null protection --- src/com/liferay/netbeansproject/util/StringUtil.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/liferay/netbeansproject/util/StringUtil.java b/src/com/liferay/netbeansproject/util/StringUtil.java index 54c7a086..5cb70db0 100644 --- a/src/com/liferay/netbeansproject/util/StringUtil.java +++ b/src/com/liferay/netbeansproject/util/StringUtil.java @@ -102,6 +102,10 @@ public static String replace(String s, String oldSub, String newSub) { } public static String[] split(String s, char delimiter) { + if (s == null) { + return new String[0]; + } + s = s.trim(); if (s.isEmpty()) {