whelan / fvtt-merchant-sheet-npc

FVTT - Merchant Sheet NPC 5E
MIT License
12 stars 13 forks source link

Sheet wont show/open #163

Open Jourhighness opened 1 year ago

Jourhighness commented 1 year ago

Describe the bug For some reason when i try to create a merchant I can't open that actor. Seems like its trying to access game.users.players. But the player object is empty.

in the prepareGMSettings function

row 351: const actor = g.actors.get(player.character.id);

To Reproduce Just create a actor NPC and change sheet to Merchant NPC I can then reproduce the bug by clicking the NPC in the Actor list.

Expected behavior To see the sheet

Screenshots image

Desktop (please complete the following information):

Jourhighness commented 1 year ago

found the reason, when there are Users that has not yet been assigned to a character the sheet crashes. att a null check for player.character as well. Change to something like....

if (p === undefined || p.character === undefined ) {
 continue;
}

https://github.com/whelan/fvtt-merchant-sheet-npc/blob/192ac5111323df9bcfdfee0fb1ec5ca9d3003413/Source/merchant/MerchantSheet.ts#L94

Fridan99 commented 1 year ago

Any progress on this? It is certain that it does NOT work, at least not on actors who are not linked to a specific actor.