mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Cast to string if necessary
This commit is contained in:
parent
718831e8e0
commit
7fb2631421
1 changed files with 5 additions and 1 deletions
|
@ -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 a new issue