Skip to content

Commit

Permalink
fix bug that is crashing the server
Browse files Browse the repository at this point in the history
  • Loading branch information
Entkenntnis committed Oct 31, 2024
1 parent 81efe87 commit d3310d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/content/mortal-coil.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export function setupMortalCoil(App) {
const isEditor = App.config.editors.includes(req.user.name)

const storageKey = `mortalcoil_${req.user.id}`
const fromDB = parseInt((await App.storage.getItem(storageKey)) ?? '-1') // should be fine
const storedLevel = await App.storage.getItem(storageKey)
const fromDB = storedLevel ? parseInt(storedLevel) : NaN
const playerLevel = isEditor
? maxLevel - 1
: isNaN(fromDB)
Expand Down

0 comments on commit d3310d4

Please sign in to comment.