files may be null if the avatar folder does not exist

master
melvin 2011-05-22 16:18:13 +08:00
parent 856d5703c5
commit d9a4df568c
1 changed files with 9 additions and 7 deletions

View File

@ -28,12 +28,14 @@ public class AvatarImages {
final File[] files=avatarPath.listFiles();
names=new Vector<String>();
for (final File file : files) {
if (file.isDirectory()) {
names.add(file.getName());
}
}
if (files != null) {
for (final File file : files) {
if (file.isDirectory()) {
names.add(file.getName());
}
}
}
}
public Vector<String> getNames() {
@ -96,4 +98,4 @@ public class AvatarImages {
return INSTANCE;
}
}
}