mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-20 00:04:27 +01:00
added type checking for CPEAnalyzer to avoid exceptions
Former-commit-id: 6f407c839f4c2f74900f46901f4a8452abe83e06
This commit is contained in:
@@ -131,8 +131,11 @@ public class Engine extends org.owasp.dependencycheck.Engine {
|
|||||||
CPEAnalyzer cpe = null;
|
CPEAnalyzer cpe = null;
|
||||||
final MavenProject project = getRootParent();
|
final MavenProject project = getRootParent();
|
||||||
if (project != null) {
|
if (project != null) {
|
||||||
|
Object obj = project.getContextValue(CPE_ANALYZER_KEY);
|
||||||
|
if (obj instanceof CPEAnalyzer) {
|
||||||
cpe = (CPEAnalyzer) project.getContextValue(CPE_ANALYZER_KEY);
|
cpe = (CPEAnalyzer) project.getContextValue(CPE_ANALYZER_KEY);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return cpe;
|
return cpe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user