mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-29 18:27:36 +02:00
Convert config values to string if casting fails
This commit is contained in:
@ -13,6 +13,11 @@ public class SharedConfig {
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T get(String path, T def) {
|
||||
Object val = configValues.get(path);
|
||||
|
||||
if (def instanceof String) {
|
||||
return (T) String.valueOf(val);
|
||||
}
|
||||
|
||||
return ( val != null ) ? (T) val : def;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user