mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 06:36:44 +01:00
Cast to string if necessary
This commit is contained in:
parent
718831e8e0
commit
7fb2631421
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user