token-mold icon indicating copy to clipboard operation
token-mold copied to clipboard

fixing some null reference exceptions

Open ryzimmer opened this issue 1 year ago • 8 comments

Fixing some null reference issues that seem to be breaking the config dialog for dnd 5e

ryzimmer avatar Feb 08 '24 18:02 ryzimmer

When I try to download the code and install on foundry I am still getting the issue. Is there a manifest url for this specific pull?

orozcojoejr avatar Feb 11 '24 18:02 orozcojoejr

No there isn’t, but it’s a pretty easy change to emulate the fix for, you can put breakpoints and run the if statements and if they’re true assign the value to an empty array, (you can do this for the first line also where I used || []). Basically the issue is just that there are a bunch of values that used to be set and seem to be null in the new version. This is meant as a quick fix, but you’re welcome to create an actual fix for the issue if you want.

Ryan

On Feb 11, 2024, at 10:12 AM, orozcojoejr @.***> wrote:



When I try to download the code and install on foundry I am still getting the issue. Is there a manifest url for this specific pull?

— Reply to this email directly, view it on GitHubhttps://github.com/Moerill/token-mold/pull/198#issuecomment-1937827029, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARKY46BCIIOJHNBMZRNJF7TYTECXBAVCNFSM6AAAAABDAHPVASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZXHAZDOMBSHE. You are receiving this because you authored the thread.Message ID: @.***>

ryzimmer avatar Feb 11 '24 20:02 ryzimmer

You could also just add a manifest change if you want to test it. I gave approvers permissions to make changes to the PR themselves.

Ryan

On Feb 11, 2024, at 12:17 PM, Ryan Zimmerman @.***> wrote:

 No there isn’t, but it’s a pretty easy change to emulate the fix for, you can put breakpoints and run the if statements and if they’re true assign the value to an empty array, (you can do this for the first line also where I used || []). Basically the issue is just that there are a bunch of values that used to be set and seem to be null in the new version. This is meant as a quick fix, but you’re welcome to create an actual fix for the issue if you want.

Ryan

On Feb 11, 2024, at 10:12 AM, orozcojoejr @.***> wrote:



When I try to download the code and install on foundry I am still getting the issue. Is there a manifest url for this specific pull?

— Reply to this email directly, view it on GitHubhttps://github.com/Moerill/token-mold/pull/198#issuecomment-1937827029, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARKY46BCIIOJHNBMZRNJF7TYTECXBAVCNFSM6AAAAABDAHPVASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZXHAZDOMBSHE. You are receiving this because you authored the thread.Message ID: @.***>

ryzimmer avatar Feb 11 '24 20:02 ryzimmer

I was looking at the console for the error and added the fixes that @Joe-Engineer approved of 15 hours ago and still wasn't able to get the settings screen to pop up, i decided to comment out lines 1317 - 1344 and I did manage to get the settings menu to open, not the most elegant fix but hey, no null pointer exceptions if theres nothing to call on the null pointer exception LOL

KomradeKoshka85 avatar Feb 25 '24 08:02 KomradeKoshka85

Actually, the issue persists. I managed to get it working perfectly (and opening the config dialog) by changing line 1081 of the tokenMold.js file from "data.actorAttributes = this._actorAttributes;" to "data.actorAttributes = this.actorAttributes;".

Yes, a single underscore was (so far) the culprit; I guess it has something to do with how v11 (or maybe D&D 5e v3, since I haven't tested other systems) handles actorAttributes.

thedmmatt avatar Feb 25 '24 20:02 thedmmatt

Cool for anyone this is blocking and can’t wait, if you just throw breakpoints in the js you can manually set the values that are null referencing to [] and it will open (it’s the 3 that my original change was setting)

On Feb 25, 2024, at 12:47 PM, Matt Dutra @.***> wrote:



Actually, the issue persists. I managed to get it working perfectly (and opening the config dialog) by changing line 1081 of the tokenMold.js file from "data.actorAttributes = this._actorAttributes;" to "data.actorAttributes = this.actorAttributes;".

Yes, a single underscore was (so far) the culprit; I guess it has something to do with how v11 (or maybe D&D 5e v3, since I haven't tested other systems) handles actorAttributes.

— Reply to this email directly, view it on GitHubhttps://github.com/Moerill/token-mold/pull/198#issuecomment-1963056594, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARKY46DEVISSKUVNZKVVTLTYVOPODAVCNFSM6AAAAABDAHPVASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRTGA2TMNJZGQ. You are receiving this because you authored the thread.Message ID: @.***>

ryzimmer avatar Feb 25 '24 20:02 ryzimmer

Just +1'ing @thedmmatt's solution, worked perfectly for me on Foundry 11.315, 5e version 3.0.3 on Mac OS Chrome.

sseritan avatar Feb 27 '24 07:02 sseritan

Also +1'ing @thedmmatt's solution which also worked for me to get the dialog to finally open by modifying the JS with dev tools. Foundry 11.315, 5e 3.1.2 on Mac OS Chrome.

Would be nice to get this merged and into the next release in case my DM needs to make more token changes :)

kmorey avatar May 15 '24 14:05 kmorey