From ec1f276f5fb2134ae4ae966e5a7d4be2505b532e Mon Sep 17 00:00:00 2001 From: Ashwin Date: Wed, 12 Jun 2024 11:16:40 +0530 Subject: [PATCH] [#13109] IndexOutOfBoundsException encountered by LogsProcessor (#13120) * #13109-added check to see if logs is empty * switch back to logs.get(list.size()-1) * [#13109] IndexOutOfBoundsException encountered by LogsProcessor --------- Co-authored-by: domoberzin <74132255+domoberzin@users.noreply.github.com> --- src/main/java/teammates/logic/api/LogsProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/teammates/logic/api/LogsProcessor.java b/src/main/java/teammates/logic/api/LogsProcessor.java index 57d889be488..66360e17be0 100644 --- a/src/main/java/teammates/logic/api/LogsProcessor.java +++ b/src/main/java/teammates/logic/api/LogsProcessor.java @@ -84,7 +84,7 @@ public int getNumberOfLogsForEvent(Instant startTime, Instant endTime, LogEvent QueryLogsResults logFetchResults = queryLogs(logsParams); List logs = logFetchResults.getLogEntries(); total += logs.size(); - if (logFetchResults.getHasNextPage()) { + if (logFetchResults.getHasNextPage() && !logs.isEmpty()) { logStartTime = logs.get(logs.size() - 1).getTimestamp(); } else { break;