fix(core.converters): 优化 FileUrlProcess 中的 URL 处理逻辑
- 在添加 URL 到 fileUrls 列表之前增加非空和非空字符串的检查- 避免将空或空字符串添加到列表中,提高数据处理的准确性
This commit is contained in:
parent
1ea23d96fa
commit
a34df121bc
@ -30,14 +30,18 @@ public class FileUrlProcess implements FieldValueProcess<String> {
|
|||||||
if (jsonElement.isJsonObject()) {
|
if (jsonElement.isJsonObject()) {
|
||||||
JsonObject jsonObject = jsonElement.getAsJsonObject();
|
JsonObject jsonObject = jsonElement.getAsJsonObject();
|
||||||
String url = getUrlByTextFile(jsonObject);
|
String url = getUrlByTextFile(jsonObject);
|
||||||
|
if (url != null && !url.isEmpty()) {
|
||||||
fileUrls.add(url);
|
fileUrls.add(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (value instanceof JsonObject) {
|
} else if (value instanceof JsonObject) {
|
||||||
JsonObject jsb = (JsonObject) value;
|
JsonObject jsb = (JsonObject) value;
|
||||||
String url = getUrlByTextFile(jsb);
|
String url = getUrlByTextFile(jsb);
|
||||||
|
if (url != null && !url.isEmpty()) {
|
||||||
fileUrls.add(url);
|
fileUrls.add(url);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return String.join(",", fileUrls);
|
return String.join(",", fileUrls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user