Skip to content

Commit 0a47194

Browse files
author
bobgarner
committed
Fixed crashing bug when a cache file can't be removed because it doesn't exist.
1 parent 500466d commit 0a47194

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/main/java/org/entityc/compiler/repository/RepositoryCache.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,13 @@ public void invalidateCacheDirectory(MTRepository repository) {
9999
}
100100
String fullPath = getBaseCacheDirectory().getAbsolutePath() + File.separator + getRepositoryCachePath(
101101
repository);
102-
try {
103-
FileUtils.cleanDirectory(new File(fullPath));
104-
} catch (IOException e) {
105-
ECLog.logWarning("Unable to remove cache directory: " + fullPath);
102+
File file = new File(fullPath);
103+
if (file.exists()) {
104+
try {
105+
FileUtils.cleanDirectory(file);
106+
} catch (IOException e) {
107+
ECLog.logWarning("Unable to remove cache directory: " + fullPath);
108+
}
106109
}
107110
}
108111

0 commit comments

Comments
 (0)