vtt-lair / foundry-group-initiative

Module for Foundry VTT that allows you to roll grouped initiative.
MIT License
3 stars 4 forks source link

Error upon deleting combat encounter #46

Closed Gawdl3y closed 2 years ago

Gawdl3y commented 2 years ago

When deleting a combat encounter, the following error is produced:

Uncaught (in promise) LibWrapperPackageError: Error detected in module Group Initiative.

This is *not* a libWrapper bug.

Find information about this module here: https://github.com/vtt-lair/foundry-group-initiative

Ask the community for support:
- FoundryVTT Discord's #modules-troubleshooting channel: https://discord.gg/foundryvtt
- FoundryVTT Reddit: https://www.reddit.com/r/FoundryVTT

== Technical Details:
Detected by libWrapper.
Package ID= group-initiative
Error= Cannot unregister 'Combat.prototype.rollAll' by module group-initiative as no such wrapper has been registered

[Detected 1 package: group-initiative]
    at pe (libWrapper-api.js:238:10)
    at 🎁unregister [as unregister] (libWrapper-api.js:627:16)
    at Object.fn (group-initiative.js:478:16)
    at #call (foundry.js:688:20)
    at Hooks.callAll (foundry.js:645:17)
    at ClientDatabaseBackend.callback (foundry.js:12887:13)
    at foundry.js:12826:43
    at Array.map (<anonymous>)
    at ClientDatabaseBackend._handleDeleteDocuments (foundry.js:12826:33)
    at i.<anonymous> (foundry.js:12234:28)
    at x.emit (index.mjs:136:20)
    at i.value (socket.js:278:20)
    at i.value (socket.js:265:18)
    at i.value (socket.js:235:22)
    at x.emit (index.mjs:136:20)
    at s.value (manager.js:200:14)
    at x.emit (index.mjs:136:20)
    at a.value (index.js:119:51)
    at s.value (manager.js:192:22)
    at x.emit (index.mjs:136:20)
    at a.value (socket.js:323:26)
    at x.emit (index.mjs:136:20)
    at i.value (transport.js:104:14)
    at i.value (transport.js:97:14)
    at ws.onmessage (websocket.js:79:40)

The error comes from this line. I'm on v10, but it doesn't look like this would be v10-specific.

vtt-lair commented 2 years ago

@Gawdl3y will have a look this week. It's kind of weird that libwrapper would throw an error if I couldn't find something to delete. Would think that it would just say, there's nothing to delete, so don't delete.

Will see what I can do to fix this. Double check to see why it's not registered.

vtt-lair commented 2 years ago

@Gawdl3y jsut testing it on 10.285 without issue. Can you check if it's still throws an error?

vtt-lair commented 2 years ago

@Gawdl3y I actually got this replicated. It will throw the error if you don't set the "Roll group initiative" setting:

image

I'll add some code to better handle this, but ticking that setting will remove the error.