mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
24 lines
1.2 KiB
Diff
24 lines
1.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Gabriel Wolf <gabrielpatrikurban@gmail.com>
|
|
Date: Sun, 5 Dec 2021 14:36:05 +0000
|
|
Subject: [PATCH] fix NPE from changes in e4358b82171
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/configuration/MemorySection.java b/src/main/java/org/bukkit/configuration/MemorySection.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/configuration/MemorySection.java
|
|
+++ b/src/main/java/org/bukkit/configuration/MemorySection.java
|
|
@@ -0,0 +0,0 @@ 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));
|