Fix NullPointerException in PartialDimExtractionFn by explicity checking for dimValue == null

This commit is contained in:
Maarten Rijke 2014-12-08 20:11:58 +01:00
parent 703470eea5
commit bd9bbf396c
2 changed files with 2 additions and 0 deletions

View File

@ -58,6 +58,7 @@ public class PartialDimExtractionFn implements DimExtractionFn
@Override
public String apply(String dimValue)
{
if (dimValue == null) return null;
Matcher matcher = pattern.matcher(dimValue);
return matcher.find() ? dimValue : null;
}

View File

@ -41,6 +41,7 @@ public class PartialDimExtractionFnTest
"Vancouver",
"Pretoria",
"Wellington",
null,
"Ontario"
};