fix: meta.json 格式错误不影响查看 application

This commit is contained in:
shizhendong
2024-11-13 18:02:54 +08:00
parent facde0a4e1
commit beb8ccdce6

View File

@@ -583,7 +583,12 @@ public class GitServiceImpl implements IGitService {
ObjectLoader loader = repository.open(treeWalk.getObjectId(0));
String metaJsonStr = T.StrUtil.utf8Str(loader.getBytes());
metaJsonStr = T.StrUtil.emptyToDefault(metaJsonStr, T.StrUtil.EMPTY_JSON);
Map metaJsonMap = T.JSONUtil.toBean(metaJsonStr, Map.class);
Map metaJsonMap = T.MapUtil.empty();
try {
metaJsonMap = T.JSONUtil.toBean(metaJsonStr, Map.class);
} catch (Exception e) {
log.error(e, "[listApplication] [meat.json format error] [applicationName: {}]", applicationName);
}
Map<Object, Object> m = T.MapUtil.newHashMap(true);
m.putAll(metaJsonMap);