Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sandbox crash when lvlX_slots_expended is NaN (easy fix) #1410

Open
ooshhub opened this issue Dec 22, 2021 · 0 comments
Open

Sandbox crash when lvlX_slots_expended is NaN (easy fix) #1410

ooshhub opened this issue Dec 22, 2021 · 0 comments

Comments

@ooshhub
Copy link
Contributor

ooshhub commented Dec 22, 2021

5e Companion

As per this Roll20 thread, non-numeric values in lvlX_slots_expended will cause the resolveslot() function to crash the API sandbox. The issue is with HTML's handling of number inputs, largely with whitespace as the error is invisible to the user, but the attribute value becomes an empty string.
An easy solution would be to change line 320, the .set() operation, to check for isNaN:
if (!isNaN(spent)) charslot.set({current: Math.max(spent - 1, 0)});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant