mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-18 17:47:05 +01:00
null check and debugging code per issue #1071
This commit is contained in:
@@ -529,16 +529,16 @@ public class DependencyBundlingAnalyzer extends AbstractDependencyComparingAnaly
|
|||||||
} else {
|
} else {
|
||||||
if (!left.matches("^\\d.*$")) {
|
if (!left.matches("^\\d.*$")) {
|
||||||
left = stripLeadingNonNumeric(left);
|
left = stripLeadingNonNumeric(left);
|
||||||
if (left == null) {
|
if (left == null || left.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Semver v = new Semver(left, SemverType.NPM);
|
Semver v = new Semver(left, SemverType.NPM);
|
||||||
if (v.satisfies(right)) {
|
if (!right.isEmpty() && v.satisfies(right)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!right.contains((" "))) {
|
if (!right.contains(" ")) {
|
||||||
left = current;
|
left = current;
|
||||||
right = stripLeadingNonNumeric(right);
|
right = stripLeadingNonNumeric(right);
|
||||||
if (right != null) {
|
if (right != null) {
|
||||||
@@ -548,6 +548,9 @@ public class DependencyBundlingAnalyzer extends AbstractDependencyComparingAnaly
|
|||||||
}
|
}
|
||||||
} catch (SemverException ex) {
|
} catch (SemverException ex) {
|
||||||
LOGGER.trace("ignore", ex);
|
LOGGER.trace("ignore", ex);
|
||||||
|
} catch (NullPointerException ex) {
|
||||||
|
LOGGER.error("SemVer comparison error: left:\"{}\", right:\"{}\"", left, right);
|
||||||
|
LOGGER.debug("SemVer comparison resulted in NPE", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user