From b8bf01acc3011cbce39c0093d29e51f55719e2f0 Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Wed, 7 May 2014 19:31:21 -0400 Subject: [PATCH] added checks before warning that a file could not be deleted Former-commit-id: 098ea1889b49ade0c73385919906398c86627ab2 --- .../org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java index b96cbf078..67415dffc 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java @@ -178,7 +178,7 @@ public class ArchiveAnalyzer extends AbstractFileTypeAnalyzer { if (tempFileLocation != null && tempFileLocation.exists()) { LOGGER.log(Level.FINE, "Attempting to delete temporary files"); final boolean success = FileUtils.delete(tempFileLocation); - if (!success) { + if (!success && tempFileLocation != null & tempFileLocation.exists()) { LOGGER.log(Level.WARNING, "Failed to delete some temporary files, see the log for more details"); } }