mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Fix sponge config loading - closes #407
This commit is contained in:
parent
234b9cafd7
commit
8618a67e2e
@ -33,6 +33,7 @@ import com.google.common.base.Splitter;
|
||||
import me.lucko.luckperms.common.config.AbstractConfiguration;
|
||||
|
||||
import ninja.leaping.configurate.ConfigurationNode;
|
||||
import ninja.leaping.configurate.SimpleConfigurationNode;
|
||||
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
|
||||
import ninja.leaping.configurate.hocon.HoconConfigurationLoader;
|
||||
import ninja.leaping.configurate.loader.ConfigurationLoader;
|
||||
@ -86,8 +87,16 @@ public class SpongeConfig extends AbstractConfiguration {
|
||||
Iterable<String> paths = Splitter.on('.').split(path);
|
||||
ConfigurationNode node = root;
|
||||
|
||||
if (node == null) {
|
||||
throw new RuntimeException("Config is not loaded.");
|
||||
}
|
||||
|
||||
for (String s : paths) {
|
||||
node = node.getNode(s);
|
||||
|
||||
if (node == null) {
|
||||
return SimpleConfigurationNode.root();
|
||||
}
|
||||
}
|
||||
|
||||
return node;
|
||||
|
Loading…
Reference in New Issue
Block a user