Skip to content

Commit

Permalink
Null protection
Browse files Browse the repository at this point in the history
  • Loading branch information
shuyangzhou committed Dec 3, 2021
1 parent a8ed1e2 commit 336017f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/com/liferay/netbeansproject/util/StringUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 336017f

Please sign in to comment.