# HG changeset patch # User Kim Alvefur # Date 1730928341 -3600 # Node ID 7b093a9b95eae03dbf3362f3fbac1e21dc98e0fb # Parent c038b1e01a0e77ec60c0f9ec2df673640e408b88 mod_report_forward: Fix traceback on error message passed to datetime function If archive:get() returns an error, e.g. because it can't find a message with the given ID, it may return e.g. nil, "item-not-found" or similar where the error condition ends up in reported_message_time, which gets passed to util.datetime, which thus ends up doing math to a string or error object. diff -r c038b1e01a0e -r 7b093a9b95ea mod_report_forward/mod_report_forward.lua --- a/mod_report_forward/mod_report_forward.lua Wed Nov 06 09:50:48 2024 +0100 +++ b/mod_report_forward/mod_report_forward.lua Wed Nov 06 22:25:41 2024 +0100 @@ -108,6 +108,7 @@ reported_message, reported_message_time, reported_message_with = archive:get(reporter_username, reported_message_el.attr.id); if jid.bare(reported_message_with) ~= event.jid then reported_message = nil; + reported_message_time = nil; end end