mirror of
https://github.com/CarmJos/EasyConfiguration.git
synced 2024-09-19 20:25:51 +00:00
fix(list): 允许出现长度为0的List (#23)
This commit is contained in:
parent
9e3dff3e95
commit
b756074ddc
@ -38,8 +38,9 @@ public class ConfiguredList<V> extends CachedConfigValue<List<V>> {
|
|||||||
public @NotNull List<V> get() {
|
public @NotNull List<V> get() {
|
||||||
if (isExpired()) { // 已过时的数据,需要重新解析一次。
|
if (isExpired()) { // 已过时的数据,需要重新解析一次。
|
||||||
List<V> list = new ArrayList<>();
|
List<V> list = new ArrayList<>();
|
||||||
List<?> data = getConfiguration().getList(getConfigPath());
|
List<?> data = getConfiguration().contains(getConfigPath()) ?
|
||||||
if (data == null || data.isEmpty()) return useOrDefault(list);
|
getConfiguration().getList(getConfigPath()) : null;
|
||||||
|
if (data == null) return useOrDefault(list);
|
||||||
for (Object dataVal : data) {
|
for (Object dataVal : data) {
|
||||||
if (dataVal == null) continue;
|
if (dataVal == null) continue;
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user