fix: writeValueAsString异常处理
This commit is contained in:
@@ -118,10 +118,11 @@ public class SitePagesController {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
var entries = (List<Map<String, Object>>) payload.get("entries");
|
var entries = (List<Map<String, Object>>) payload.get("entries");
|
||||||
sitePagesService.savePages("default:" + type, entries != null ? entries : List.of());
|
sitePagesService.savePages("default:" + type, entries != null ? entries : List.of());
|
||||||
String json = payload.containsKey("entries")
|
try {
|
||||||
? new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(entries)
|
String json = entries != null
|
||||||
: "[]";
|
? new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(entries) : "[]";
|
||||||
storageService.store("pages/default/" + type + ".json", json);
|
storageService.store("pages/default/" + type + ".json", json);
|
||||||
|
} catch (Exception ignored) {}
|
||||||
return ApiResponse.success();
|
return ApiResponse.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user