From: Svjatoslav Agejenko Date: Thu, 26 Dec 2013 18:23:53 +0000 (+0200) Subject: null safe wildcard matching X-Git-Tag: svjatoslavcommons-1.8~111 X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=77e2799e9c1d172132cf0d47b78eec2f0925bbe2;p=svjatoslav_commons.git null safe wildcard matching --- diff --git a/src/main/java/eu/svjatoslav/commons/string/WildCardMatcher.java b/src/main/java/eu/svjatoslav/commons/string/WildCardMatcher.java index 6e3031d..3090184 100755 --- a/src/main/java/eu/svjatoslav/commons/string/WildCardMatcher.java +++ b/src/main/java/eu/svjatoslav/commons/string/WildCardMatcher.java @@ -37,6 +37,12 @@ public class WildCardMatcher { public static boolean match(final String inputString, final String wildcardExpression) { + if (inputString == null) + return false; + + if (wildcardExpression == null) + return false; + int i; for (i = 0; i < inputString.length(); i++) {