* account for weird data

This commit is contained in:
Reinhard Pointner 2012-12-06 17:47:39 +00:00
parent ee6330a10c
commit f73a07a06b
2 changed files with 13 additions and 13 deletions

View File

@ -79,9 +79,8 @@ class FileTreeTransferablePolicy extends BackgroundFileTransferablePolicy<Abstra
if (Thread.interrupted())
throw new InterruptedException();
if (file.isDirectory()) {
File[] files = file.listFiles();
File[] files = file.listFiles();
if (files != null && file.isDirectory()) {
FolderNode node = new FolderNode(FileUtilities.getFolderName(file), files.length);
// add folders first

View File

@ -46,12 +46,13 @@ public class FastFile extends File {
@Override
public File[] listFiles() {
String[] names = list();
File[] files = new File[names.length];
if (names == null)
return null;
File[] files = new File[names.length];
for (int i = 0; i < names.length; i++) {
files[i] = new FastFile(this, names[i]);
}
return files;
}