From coverity: listFiles may return null

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2279 3d1905a2-6b24-0410-a738-b14d5a86fcbd
master
mguessan 2014-03-20 22:08:05 +00:00
parent abf481b39e
commit 1ea2466575
1 changed files with 5 additions and 3 deletions

View File

@ -2591,9 +2591,11 @@ public abstract class ExchangeSession {
return false;
}
});
for (File file : oldestFiles) {
if (!file.delete()) {
LOGGER.warn("Unable to delete " + file.getAbsolutePath());
if (oldestFiles != null) {
for (File file : oldestFiles) {
if (!file.delete()) {
LOGGER.warn("Unable to delete " + file.getAbsolutePath());
}
}
}
} catch (Exception ex) {