# HG changeset patch # User Kim Alvefur # Date 1658315287 -7200 # Node ID 30e2a01072178da80793b3d73e3f9c44933ec9ce # Parent 1ce98f27eabebffba0f58cdb62b1ddaa602afe05 moduleapi: Stricter type check for actor in permission check Non-table but truthy values would trigger "attempt to index a foo value" on the next line otherwise diff -r 1ce98f27eabe -r 30e2a0107217 core/moduleapi.lua --- a/core/moduleapi.lua Wed Jul 20 13:07:04 2022 +0200 +++ b/core/moduleapi.lua Wed Jul 20 13:08:07 2022 +0200 @@ -645,7 +645,7 @@ end local session = context.origin or context.session; - if not session then + if type(session) ~= "table" then error("Unable to identify actor session from context"); end if session.type == "s2sin" or (session.type == "c2s" and session.host ~= self.host) then