From 05fe53ec5e144a1e3e757f064fc1e0d97856bd72 Mon Sep 17 00:00:00 2001 From: Xiaochen Wang Date: Thu, 10 Oct 2024 11:37:47 +0800 Subject: [PATCH] fix incorrect return value from Workspaces:select_by_name --- 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 9762479a7c4cd..a0a40c43e8efc 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)