From 7fb263142127669260bbec489a1f264bb5de796b Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 21 Jun 2016 14:23:04 +1000 Subject: [PATCH] Cast to string if necessary --- .../java/com/intellectualcrafters/plot/config/Config.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/config/Config.java b/Core/src/main/java/com/intellectualcrafters/plot/config/Config.java index 1fbdb8c19..cf9ab4785 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/config/Config.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/config/Config.java @@ -65,9 +65,13 @@ public class Config { if (field.getAnnotation(Final.class) != null) { return; } + if (field.getType() == String.class && !(value instanceof String)) { + value = value + ""; + } field.set(instance, value); return; - } catch (IllegalAccessException e) { + } catch (Throwable e) { + PS.debug("Invalid configuration value: " + key + ": " + value + " in " + root.getSimpleName()); e.printStackTrace(); } }