Skip to content

Commit

Permalink
fix nonexistent key lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
Awesome-E committed Sep 17, 2024
1 parent a62985c commit 854717b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modules/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const ServerSettings = mongoose.model('server-settings', new mongoose.Schema({
const serverSettingsDB = {
get: async function (serverID) {
const response = await ServerSettings.findById(serverID).lean()
if (!response) return null

// for auto type recognition to be correct
const data = { ...response, key: response._id, _id: undefined }
return data
Expand Down

0 comments on commit 854717b

Please sign in to comment.