From 1088ccb8d1ec382652c2c3680fa96635e7e02ff7 Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Mon, 13 Nov 2023 13:26:41 -0800 Subject: [PATCH] luahost: add type check TODOs (#436) Signed-off-by: James Hillyerd --- pkg/extension/luahost/bind_inboundmessage.go | 1 + pkg/extension/luahost/bind_message.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/extension/luahost/bind_inboundmessage.go b/pkg/extension/luahost/bind_inboundmessage.go index 12dc6cd..2b3d242 100644 --- a/pkg/extension/luahost/bind_inboundmessage.go +++ b/pkg/extension/luahost/bind_inboundmessage.go @@ -116,6 +116,7 @@ func inboundMessageNewIndex(ls *lua.LState) int { to := make([]mail.Address, 0, 16) lt.ForEach(func(k, lv lua.LValue) { if ud, ok := lv.(*lua.LUserData); ok { + // TODO should fail if wrong type + test. if entry, ok := unwrapMailAddress(ud); ok { to = append(to, *entry) } diff --git a/pkg/extension/luahost/bind_message.go b/pkg/extension/luahost/bind_message.go index 813502c..c14f3a2 100644 --- a/pkg/extension/luahost/bind_message.go +++ b/pkg/extension/luahost/bind_message.go @@ -99,6 +99,7 @@ func messageMetadataNewIndex(ls *lua.LState) int { to := make([]*mail.Address, 0, 16) lt.ForEach(func(k, lv lua.LValue) { if ud, ok := lv.(*lua.LUserData); ok { + // TODO should fail if wrong type + test. if entry, ok := unwrapMailAddress(ud); ok { to = append(to, entry) }