Catch FileNotFoundException in YamlFileStore.

This commit is contained in:
sk89q 2014-08-18 10:39:53 -07:00
parent ae8bf63c86
commit 929f9e99cd

View File

@ -42,6 +42,7 @@
import org.yaml.snakeyaml.representer.Representer; import org.yaml.snakeyaml.representer.Representer;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -107,7 +108,11 @@ public Set<ProtectedRegion> loadAll() throws IOException {
Map<String, ProtectedRegion> loaded = new HashMap<String, ProtectedRegion>(); Map<String, ProtectedRegion> loaded = new HashMap<String, ProtectedRegion>();
YAMLProcessor config = createYamlProcessor(file); YAMLProcessor config = createYamlProcessor(file);
try {
config.load(); config.load();
} catch (FileNotFoundException e) {
return new HashSet<ProtectedRegion>(loaded.values());
}
Map<String, YAMLNode> regionData = config.getNodes("regions"); Map<String, YAMLNode> regionData = config.getNodes("regions");