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

Add check if canvas is enabled #5

Open
shawly opened this issue Mar 7, 2022 · 0 comments
Open

Add check if canvas is enabled #5

shawly opened this issue Mar 7, 2022 · 0 comments

Comments

@shawly
Copy link

shawly commented Mar 7, 2022

Since FVTT 0.8.6 the canvas can be disabled per client so this call

canvas.grid.addHighlightLayer(this._name);
produces an error in the console when the canvas is disabled, since canvas.grid is undefined.

TypeError: Cannot read properties of undefined (reading 'addHighlightLayer')
[Detected 1 package: lib-find-the-path]
    at new FTPUtility (utility.js:14:15)
    at pathManager.js:515:29
    at Function._call (foundry.js:294:14)
    at Function.callAll (foundry.js:253:12)
    at Game.setupGame (foundry.js:5566:11)
    at async Game._initializeGameView (foundry.js:6498:5)
    at async Game.initialize (foundry.js:5430:5)

It might make sense to check if game.settings.get("core", "noCanvas") is enabled before executing the code within the "ready" hook

Hooks.on ("ready", () =>

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