crnormand / gurps

Implementing a GURPS 4e game aid for Foundry VTT
MIT License
102 stars 49 forks source link

Fix bug that prevented notes deletion #1930

Closed Wilou1428 closed 1 month ago

Wilou1428 commented 1 month ago

There was an error preventing me from deleting notes from a character sheet:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'utils')
    at Object.removeKey (gurps.js:1569:42)
    at Object.callback (actor-sheet.js:509:17)
    at #onClickItem (foundry.js:67909:11)
    at HTMLElement.dispatch (jquery.min.js:2:40035)
    at v.handle (jquery.min.js:2:38006)

I've noticed there was a weird duplication function call inside removeKey:

foundry.utils.foundry.utils.duplicate(GURPS.decode(actor, objpath))

So I've removed one of the foundry.utils and it fixed the bug.