From 1ccb091fcdc20e67893253f816f5d8622021c59d Mon Sep 17 00:00:00 2001 From: Redempt Date: Tue, 21 Dec 2021 23:59:43 -0500 Subject: [PATCH] Fix ClassCastException in ConfigManager --- res/plugin.yml | 2 +- src/redempt/redlib/config/data/ListDataHolder.java | 3 ++- src/redempt/redlib/config/data/MapDataHolder.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/res/plugin.yml b/res/plugin.yml index 882484b..1a9bc04 100755 --- a/res/plugin.yml +++ b/res/plugin.yml @@ -1,6 +1,6 @@ name: RedLib main: redempt.redlib.RedLib -version: 2021-12-22 04:46 +version: 2021-12-22 04:59 author: Redempt api-version: 1.13 load: STARTUP diff --git a/src/redempt/redlib/config/data/ListDataHolder.java b/src/redempt/redlib/config/data/ListDataHolder.java index fa2bcc2..fc8b058 100644 --- a/src/redempt/redlib/config/data/ListDataHolder.java +++ b/src/redempt/redlib/config/data/ListDataHolder.java @@ -70,7 +70,8 @@ public boolean isSet(String path) { @Override public String getString(String path) { - return (String) get(path); + Object val = get(path); + return val == null ? null : String.valueOf(val); } @Override diff --git a/src/redempt/redlib/config/data/MapDataHolder.java b/src/redempt/redlib/config/data/MapDataHolder.java index b645db6..f3b333f 100644 --- a/src/redempt/redlib/config/data/MapDataHolder.java +++ b/src/redempt/redlib/config/data/MapDataHolder.java @@ -53,7 +53,8 @@ public boolean isSet(String path) { @Override public String getString(String path) { - return (String) map.get(path); + Object val = get(path); + return val == null ? null : String.valueOf(val); } @Override