#686: Fix contains for default section generating real sections

By: Wolf2323 <gabrielpatrikurban@gmail.com>
This commit is contained in:
Bukkit/Spigot
2021-12-04 22:05:54 +01:00
parent 3ddde21487
commit ab0429fddc
2 changed files with 12 additions and 2 deletions

View File

@@ -251,10 +251,10 @@ public class MemorySection implements ConfigurationSection {
int i1 = -1, i2;
ConfigurationSection section = this;
while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) {
section = section.getConfigurationSection(path.substring(i2, i1));
if (section == null) {
if (section == null || !section.contains(path.substring(i2, i1), true)) {
return def;
}
section = section.getConfigurationSection(path.substring(i2, i1));
}
String key = path.substring(i2);