mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +01:00
#687: Fix NPE from previous commits
By: Wolf2323 <gabrielpatrikurban@gmail.com>
This commit is contained in:
parent
ab0429fddc
commit
308cc50afa
1 changed files with 6 additions and 2 deletions
|
@ -251,10 +251,14 @@ public class MemorySection implements ConfigurationSection {
|
|||
int i1 = -1, i2;
|
||||
ConfigurationSection section = this;
|
||||
while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) {
|
||||
if (section == null || !section.contains(path.substring(i2, i1), true)) {
|
||||
final String currentPath = path.substring(i2, i1);
|
||||
if (!section.contains(currentPath, true)) {
|
||||
return def;
|
||||
}
|
||||
section = section.getConfigurationSection(currentPath);
|
||||
if (section == null) {
|
||||
return def;
|
||||
}
|
||||
section = section.getConfigurationSection(path.substring(i2, i1));
|
||||
}
|
||||
|
||||
String key = path.substring(i2);
|
||||
|
|
Loading…
Reference in a new issue