From d9a4df568cfe17097537bc464e7f9f0d9408011e Mon Sep 17 00:00:00 2001 From: melvin Date: Sun, 22 May 2011 16:18:13 +0800 Subject: [PATCH] files may be null if the avatar folder does not exist --- src/magic/data/AvatarImages.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/magic/data/AvatarImages.java b/src/magic/data/AvatarImages.java index 930b4f6108..81ed8d3db3 100644 --- a/src/magic/data/AvatarImages.java +++ b/src/magic/data/AvatarImages.java @@ -28,12 +28,14 @@ public class AvatarImages { final File[] files=avatarPath.listFiles(); names=new Vector(); - 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 getNames() { @@ -96,4 +98,4 @@ public class AvatarImages { return INSTANCE; } -} \ No newline at end of file +}