protected Object[] getChildren()
{
if (children != null)
{
return children;
}
try
{
String[] files = file.list();
if (files != null)
{
fileMS.sort(files);
children = new FileNode[files.length];
String path = file.getPath();
for (int i = 0; i < files.length; i++)
{
File childFile = new File(path, files[i]);
if (childFile.isDirectory())
children[i] = new FileNode(childFile);
}
}
}
catch (SecurityException se)
{
}
return children;
}这个方法,我想要返回只是文件夹的children,为什么我不管怎么试都是
java.lang.NullPointerException: Null child not allowed?