# HG changeset patch # User Kim Alvefur # Date 1681847311 -7200 # Node ID 14b6397cd6dee2c938a940dc63ffbf974c17841d # Parent f6577cdb1d911a945d27279a521287b0189a418c mod_audit_status: Fix error on first start Fixes 'attempt to index a nil value' the first time this module is loaded, since there's no data yet. diff -r f6577cdb1d91 -r 14b6397cd6de mod_audit_status/mod_audit_status.lua --- a/mod_audit_status/mod_audit_status.lua Mon Apr 17 14:31:50 2023 +0100 +++ b/mod_audit_status/mod_audit_status.lua Tue Apr 18 21:48:31 2023 +0200 @@ -11,7 +11,7 @@ module:hook_global("server-started", function () local recorded_status = store:get(); - if recorded_status.status == "started" then + if recorded_status and recorded_status.status == "started" then module:audit(nil, "server-crashed", { timestamp = recorded_status.heartbeat }); end module:audit(nil, "server-started");