fix(java): correct version author when changes exist. Fix Bug 73505

This commit is contained in:
sshakndr
2025-03-17 14:54:21 +07:00
parent a5d98055ce
commit a16318fa71

View File

@ -960,7 +960,8 @@ public class IndexServlet extends HttpServlet {
JSONObject changes = (JSONObject) parser.parse(
DocumentManager.readFileToEnd(new File(DocumentManager
.versionDir(histDir, i - 1) + File.separator + "changes.json")));
JSONObject change = (JSONObject) ((JSONArray) changes.get("changes")).get(0);
JSONObject change = (JSONObject) ((JSONArray) changes.get("changes"))
.get(((JSONArray) changes.get("changes")).size() - 1);
// write information about changes to the object
obj.put("changes", !change.isEmpty() ? changes.get("changes") : null);