LabelTypeHelper: Add null guard for excludedPaths

This fixes a warning from LGTM:

    Variable excludedPaths may be null here as suggested
    by this null guard.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-10-14 21:05:41 +02:00
parent a6f23d164c
commit 8ea50e9a43

View file

@ -261,11 +261,13 @@ public class LabelTypeHelper {
}
return false;
} else {
final boolean match = !excludedPaths.matcher(path).matches();
if (!match && logger.isDebugEnabled()) {
logger.debug("Path " + path + " matched against the excludes paths expression " + excludedPaths.toString());
if (excludedPaths != null && excludedPaths.matcher(path).matches()) {
if (logger.isDebugEnabled()) {
logger.debug("Path " + path + " matched against the excludes paths expression " + excludedPaths.toString());
}
return false;
}
return match;
return true;
}
}