avoid NPE in escapeValue()

This commit is contained in:
Jörg Prante 2022-06-23 14:15:24 +02:00
parent b87ccbe123
commit 62656e061f

View file

@ -384,6 +384,9 @@ public class LDAP {
} }
public static String escapeValue(String filter) { public static String escapeValue(String filter) {
if (filter == null) {
return null;
}
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int i = 0; i < filter.length(); i++) { for (int i = 0; i < filter.length(); i++) {
switch (filter.charAt(i)) { switch (filter.charAt(i)) {
@ -423,5 +426,4 @@ public class LDAP {
} }
return sb.toString(); return sb.toString();
} }
} }