Skip to content

Commit

Permalink
fix incorrect return value from Workspaces:select_by_name
Browse files Browse the repository at this point in the history
  • Loading branch information
chobits committed Oct 10, 2024
1 parent 335acb0 commit 05fe53e
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 05fe53e

Please sign in to comment.