forked from LogBlock/LogBlock
Print a warning and skip invalid data in serialized blockstates
This commit is contained in:
@ -16,6 +16,7 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
import java.util.zip.ZipException;
|
||||
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
@ -259,6 +260,9 @@ public class Utils {
|
||||
conf.load(reader);
|
||||
reader.close();
|
||||
return conf;
|
||||
} catch (ZipException e) {
|
||||
LogBlock.getInstance().getLogger().warning("Could not deserialize YamlConfiguration: " + e.getMessage());
|
||||
return conf;
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("IOException should be impossible for ByteArrayInputStream", e);
|
||||
}
|
||||
|
Reference in New Issue
Block a user