ShoyuVanilla / FoundryVTT-Chat-Portrait

Other
14 stars 24 forks source link

Image missing from elementItemImageList #85

Closed Wigginns closed 2 years ago

Wigginns commented 2 years ago

In order to submit an effective bug report, please include the following information along with your issue description.

Environment Details

Please share the following basic details about your setup.

Issue Description

Combat utility belt has an option to automate concentration. When this happens it outputs a message to the chatlog detailing who is concentrating and on what. However, the img for "Concentrator" is undefined. It still shows up in the list of images (src/module/ChatPortrait.ts: 359 elementItemImageList) to be parsed in the card but is undefined, creates and error and displays a missing image icon.

image

image

I believe this bug is caused by CUB's card formatting in some manner but there may be value in Chat Portrait handling this error in a more graceful manner such as displaying a placeholder or displaying nothing.

I patched my local installation to simply check if elementItemImage is defined and if not to just continue to the next image in the list. I'm sure there is a way to do that in typescript but I am having a hell of a time installing the project on my local to try it (likely a problem with my Windows setup -_-)

Edit: Turns out I need to use the node v14 lts 👍

p4535992 commented 2 years ago

should be patched with version 0.5.29 let me know.

Wigginns commented 2 years ago

Appreciate the quick fix. It no longer generates an error or fills in a with a missing img icon but I get an unknown source still.

image <img width="36" height="36" src="" class="message-portrait">

Again, this is likely a Combat Utility Belt issue more than anything. Personally, I might just show nothing if an image can't be found but I don't feel strongly about it.

image

p4535992 commented 2 years ago

should be patched (again) with version 0.5.31 let me know.

Wigginns commented 2 years ago

Looks great! Thanks!