DS-2355 uncaught NPE resulting in loss of statistic

This commit is contained in:
bill
2014-12-10 09:18:57 -06:00
committed by Ivan Masár
parent 2d4200971f
commit 845532b29d

View File

@@ -205,7 +205,8 @@ public class SpiderDetector {
for (Pattern candidate : agents)
{
if (candidate.matcher(agent).find())
// prevent matcher() invocation from a null Pattern object
if (null != candidate && candidate.matcher(agent).find())
{
return true;
}
@@ -236,7 +237,8 @@ public class SpiderDetector {
for (Pattern candidate : domains)
{
if (candidate.matcher(hostname).find())
// prevent matcher() invocation from a null Pattern object
if (null != candidate && candidate.matcher(hostname).find())
{
return true;
}