Do not crash script if a directory cannot be read.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@7423 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
21b86eeaa0
commit
9dbb520cc3
|
@ -22,6 +22,10 @@ void normalizeMap(File mapFile, String mapPath) {
|
|||
|
||||
void normalizeDirectory(File mapFile, String mapPath) {
|
||||
File[] files = mapFile.listFiles();
|
||||
if (files == null) {
|
||||
print("Cannot read directory " + mapFile);
|
||||
return;
|
||||
}
|
||||
for (File file : files) {
|
||||
String name = file.getName();
|
||||
if (!name.equals(".svn") && !name.equals("README")) {
|
||||
|
|
|
@ -70,6 +70,10 @@ void checkMap(File mapFile, String mapPath) {
|
|||
|
||||
void checkDirectory(File mapFile, String mapPath) {
|
||||
File[] files = mapFile.listFiles();
|
||||
if (files == null) {
|
||||
log("Cannot read directory " + mapFile);
|
||||
return;
|
||||
}
|
||||
for (File file : files) {
|
||||
String name = file.getName();
|
||||
if (!name.equals(".svn") && !name.equals("README")) {
|
||||
|
|
Loading…
Reference in New Issue