Skip to content

Commit

Permalink
fix incorrect return value from Workspaces:select_by_name (#13733)
Browse files Browse the repository at this point in the history
  • Loading branch information
chobits authored and dndx committed Oct 16, 2024
1 parent edefc69 commit 8230d22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kong/db/dao/workspaces.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8230d22

Please sign in to comment.