Merge pull request #98 from BentoBoxWorld/97_NPE_on_reset

Add protection around null sections. #97
This commit is contained in:
tastybento 2024-10-19 10:41:34 -07:00 committed by GitHub
commit b3a81c6f78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -65,7 +65,7 @@
<!-- Do not change unless you want different name for local builds. --> <!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number> <build.number>-LOCAL</build.number>
<!-- This allows to change between versions. --> <!-- This allows to change between versions. -->
<build.version>2.7.2</build.version> <build.version>2.7.3</build.version>
<sonar.projectKey>BentoBoxWorld_Boxed</sonar.projectKey> <sonar.projectKey>BentoBoxWorld_Boxed</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization> <sonar.organization>bentobox-world</sonar.organization>

View File

@ -358,6 +358,9 @@ public class NewAreaListener implements Listener {
} }
private void place(ConfigurationSection section, Location center, Environment env) { private void place(ConfigurationSection section, Location center, Environment env) {
if (section == null) {
return;
}
World world = env.equals(Environment.NORMAL) ? addon.getOverWorld() : addon.getNetherWorld(); World world = env.equals(Environment.NORMAL) ? addon.getOverWorld() : addon.getNetherWorld();
if (world == null) { if (world == null) {
return; return;