Commit 721da7a2 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

Workaround issue with listFiles...

I wonder how can this happen...
parent bb5dfe0f
......@@ -226,14 +226,20 @@ public class MediaLibrary {
}
// Filter the extensions and the folders
if ((f = dir.listFiles(mediaFileFilter)) != null) {
for (File file : f) {
if (file.isFile()) {
mediaToScan.add(file);
} else if (file.isDirectory()) {
directories.push(file);
try {
if ((f = dir.listFiles(mediaFileFilter)) != null) {
for (File file : f) {
if (file.isFile()) {
mediaToScan.add(file);
} else if (file.isDirectory()) {
directories.push(file);
}
}
}
} catch (Exception e)
{
// listFiles can fail in OutOfMemoryError, go to the next folder
continue;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment