Skip to content

Updating the prototype token image of unlinked actors does not work if the actor has no active token #2

@JenniferPylko

Description

@JenniferPylko

This error is logged in the console:

Uncaught (in promise) Error: undefined. The key undefined does not exist in the Actors Collection
[Detected 1 package: art-gallery]
    at Actors.get (commons.js:3289:15)
    at ArtGalleryManager._onSetPrototypeTokenArt (GalleryManager.js:223:33)
    at #onClickItem (foundry.js:56177:11)
    at HTMLElement.dispatch (jquery.min.js:2:43064)
    at y.handle (jquery.min.js:2:41048)

I believe this is due to GalleryManager.js:222, which depends on this.actor.token.

I think replacing line 222 with this would fix it:
const actorId = this.actor?.token?.actorId ?? this.actor?.id;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions