mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-30 13:52:16 +02:00
fixed null pointer exception
Former-commit-id: d66364e752e80fc90fb2fe226b272ba63879d104
This commit is contained in:
@@ -139,10 +139,13 @@ public final class CliParser {
|
|||||||
final String msg = String.format("Invalid '%s' argument: null", argumentName);
|
final String msg = String.format("Invalid '%s' argument: null", argumentName);
|
||||||
throw new FileNotFoundException(msg);
|
throw new FileNotFoundException(msg);
|
||||||
} else if (!path.contains("*") && !path.contains("?")) {
|
} else if (!path.contains("*") && !path.contains("?")) {
|
||||||
final File f = new File(path);
|
File f = new File(path);
|
||||||
if ("o".equals(argumentName.substring(0, 1).toLowerCase()) && !"ALL".equals(this.getReportFormat().toUpperCase())) {
|
if ("o".equals(argumentName.substring(0, 1).toLowerCase()) && !"ALL".equals(this.getReportFormat().toUpperCase())) {
|
||||||
final String checkPath = path.toLowerCase();
|
final String checkPath = path.toLowerCase();
|
||||||
if (checkPath.endsWith(".html") || checkPath.endsWith(".xml") || checkPath.endsWith(".htm")) {
|
if (checkPath.endsWith(".html") || checkPath.endsWith(".xml") || checkPath.endsWith(".htm")) {
|
||||||
|
if (f.getParentFile() == null) {
|
||||||
|
f = new File(".", path);
|
||||||
|
}
|
||||||
if (!f.getParentFile().isDirectory()) {
|
if (!f.getParentFile().isDirectory()) {
|
||||||
isValid = false;
|
isValid = false;
|
||||||
final String msg = String.format("Invalid '%s' argument: '%s'", argumentName, path);
|
final String msg = String.format("Invalid '%s' argument: '%s'", argumentName, path);
|
||||||
|
|||||||
Reference in New Issue
Block a user