# HG changeset patch # User Matthew Wild # Date 1701875229 0 # Node ID 5239ed05bd718bc40af4cdbd07319e06754265b1 # Parent 4c3216d9b1182bcc9dca2684de3ee8cb402113d8 mod_lastlog2: Fix to interpret stored data structure correctly diff -r 4c3216d9b118 -r 5239ed05bd71 mod_lastlog2/mod_lastlog2.lua --- a/mod_lastlog2/mod_lastlog2.lua Wed Dec 06 12:14:12 2023 +0000 +++ b/mod_lastlog2/mod_lastlog2.lua Wed Dec 06 15:07:09 2023 +0000 @@ -56,7 +56,9 @@ else local last_activity = kv_store:get(username); if not last_activity then return nil; end - local latest = math.max(last_activity.login or 0, last_activity.logout or 0); + local last_login = last_activity.login; + local last_logout = last_activity.logout; + local latest = math.max(last_login and last_login.timestamp or 0, last_logout and last_logout.timestamp or 0); if latest == 0 then return nil; -- Never logged in end