From 8230d22abd0be6d4db7c6fa08c3c434eaa909d12 Mon Sep 17 00:00:00 2001 From: Xiaochen Wang Date: Thu, 10 Oct 2024 12:13:33 +0800 Subject: [PATCH] fix incorrect return value from Workspaces:select_by_name (#13733) --- kong/db/dao/workspaces.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kong/db/dao/workspaces.lua b/kong/db/dao/workspaces.lua index 9762479a7c4c..a0a40c43e8ef 100644 --- a/kong/db/dao/workspaces.lua +++ b/kong/db/dao/workspaces.lua @@ -28,7 +28,8 @@ end function Workspaces:select_by_name(key, options) if kong.configuration.database == "off" and key == "default" then -- it should be a table, not a single string - return { id = lmdb.get(DECLARATIVE_DEFAULT_WORKSPACE_KEY), } + local id = lmdb.get(DECLARATIVE_DEFAULT_WORKSPACE_KEY) + return id and { id = lmdb.get(DECLARATIVE_DEFAULT_WORKSPACE_KEY), } or nil end return self.super.select_by_name(self, key, options)