From 77e2799e9c1d172132cf0d47b78eec2f0925bbe2 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Thu, 26 Dec 2013 20:23:53 +0200 Subject: [PATCH] null safe wildcard matching --- .../java/eu/svjatoslav/commons/string/WildCardMatcher.java | 6 ++++++ 1 file changed, 6 insertions(+) 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++) { -- 2.20.1