mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-26 02:57:42 +01:00
Catch FileNotFoundException in YamlFileStore.
This commit is contained in:
parent
ae8bf63c86
commit
929f9e99cd
@ -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");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user