From 67cf1b45ed3a18f69546c8072415e330f3d30b28 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 1 Apr 2019 04:43:44 +1100 Subject: [PATCH] Fix another legacy converter NPE --- .../plotsquared/plot/util/LegacyConverter.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyConverter.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyConverter.java index a12b82c95..f904249dd 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyConverter.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/LegacyConverter.java @@ -113,12 +113,14 @@ import java.util.Map; for (final String world : worlds) { final ConfigurationSection worldSection = configuration.getConfigurationSection(world); for (final Map.Entry entry : TYPE_MAP.entrySet()) { - if (entry.getValue() == ConfigurationType.BLOCK) { - this.convertBlock(worldSection, entry.getKey(), - worldSection.getString(entry.getKey())); - } else { - this.convertBlockList(worldSection, entry.getKey(), - worldSection.getStringList(entry.getKey())); + if (worldSection.contains(entry.getKey())) { + if (entry.getValue() == ConfigurationType.BLOCK) { + this.convertBlock(worldSection, entry.getKey(), + worldSection.getString(entry.getKey())); + } else { + this.convertBlockList(worldSection, entry.getKey(), + worldSection.getStringList(entry.getKey())); + } } } }