From 0f25a2264ebd3ffc7540bd41f9970ede288b6ef4 Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Tue, 22 Oct 2024 16:39:51 +0800 Subject: [PATCH] fix code --- kong/tls/plugins/certificate.lua | 3 +++ kong/tls/plugins/sni_filter.lua | 1 + 2 files changed, 4 insertions(+) diff --git a/kong/tls/plugins/certificate.lua b/kong/tls/plugins/certificate.lua index cdfa925596ef..bf93298136f8 100644 --- a/kong/tls/plugins/certificate.lua +++ b/kong/tls/plugins/certificate.lua @@ -97,6 +97,9 @@ function _M.execute(snis_set) end function _M.execute_client_hello(snis_set, options) + if not snis_set then + return + end if not options then return diff --git a/kong/tls/plugins/sni_filter.lua b/kong/tls/plugins/sni_filter.lua index 0203770b57c9..4b2a6c3b6390 100644 --- a/kong/tls/plugins/sni_filter.lua +++ b/kong/tls/plugins/sni_filter.lua @@ -246,6 +246,7 @@ local function each_enabled_plugin(entity, plugin_name) local iter = entity:each(1000, options) local function iterator() + if not iter then return end local element, err = iter() if err then return nil, err end if element == nil then return end