jaltepeter / MountUp

Mount Up! is a module for Foundry VTT that allows tokens to carry or be carried by other tokens. This is completely system agnostic, and fully customizable to fit right into your game.
https://brunhine.com/fvtt/mountup
Apache License 2.0
9 stars 9 forks source link

[BUG] Cannot read property 'id' of undefined in Function.popRider #7

Open Merudo opened 4 years ago

Merudo commented 4 years ago

Describe the bug Copy-pasting / deleting tokens that have been paired by MountUp can cause crashes and errors.

Specifically, it can create the following error:

mountup.js:17 Uncaught (in promise) TypeError: Cannot read property 'id' of undefined

The problematic lines:

if (riderToken) {
    riderToken.zIndex = mountToken.zIndex + 10;
}

if (this.isaMount(riderToken.id)) {
    this.popRider(riderToken.id, callcount += 1);
 }

code can be found here.

Environment Details Foundry VTT Version: 0.6.5 Mount Up! Version: 3.0.1