From 74795cb3229f6d10fabed4ad3aee9ed902e98773 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:50:55 +0600 Subject: [PATCH] Make reply of ACL LOG compatible with older Redis versions (#4030) --- .../redis/clients/jedis/resps/AccessControlLogEntry.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/redis/clients/jedis/resps/AccessControlLogEntry.java b/src/main/java/redis/clients/jedis/resps/AccessControlLogEntry.java index 930c9b064d..922d37fd6a 100644 --- a/src/main/java/redis/clients/jedis/resps/AccessControlLogEntry.java +++ b/src/main/java/redis/clients/jedis/resps/AccessControlLogEntry.java @@ -47,9 +47,10 @@ public AccessControlLogEntry(Map map) { ageSeconds = (Double) map.get(AGE_SECONDS); clientInfo = getMapFromRawClientInfo((String) map.get(CLIENT_INFO)); logEntry = map; - entryId = (long) map.get(ENTRY_ID); - timestampCreated = (long) map.get(TIMESTAMP_CREATED); - timestampLastUpdated = (long) map.get(TIMESTAMP_LAST_UPDATED); + // Redis 7.2 + entryId = map.containsKey(ENTRY_ID) ? (long) map.get(ENTRY_ID) : -1L; + timestampCreated = map.containsKey(TIMESTAMP_CREATED) ? (long) map.get(TIMESTAMP_CREATED) : -1L; + timestampLastUpdated = map.containsKey(TIMESTAMP_LAST_UPDATED) ? (long) map.get(TIMESTAMP_LAST_UPDATED) : -1L; } public long getCount() {