mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 23:13:10 +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)
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -236,7 +237,8 @@ public class SpiderDetector {
|
|||||||
|
|
||||||
for (Pattern candidate : domains)
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user