mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
DS-2355 uncaught NPE resulting in loss of statistic
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user