Skip to content

Commit

Permalink
Merge pull request #52 from TheGiddyLimit/bugfix/error-on-view-new-scene
Browse files Browse the repository at this point in the history
Avoid crash on viewing/activating new sene
  • Loading branch information
mclemente authored Nov 5, 2022
2 parents ec43f5b + 5e60421 commit 91a4bfc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions about-face.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ Hooks.once("init", () => {
precedence: CONST.KEYBINDING_PRECEDENCE.NORMAL,
});
});
Hooks.on("canvasReady", () => {
if (canvas.scene?.flags?.[MODULE_ID] == undefined) canvas.scene.setFlag(MODULE_ID, "sceneEnabled", true);
Hooks.on("canvasReady", async () => {
if (canvas.scene?.flags?.[MODULE_ID] == null) await canvas.scene.setFlag(MODULE_ID, "sceneEnabled", true);
if (canvas.scene?.flags?.[MODULE_ID].sceneEnabled) canvas.scene.tokens.forEach((tokenDocument) => drawAboutFaceIndicator(tokenDocument.object));
});
Hooks.on("preCreateToken", onPreCreateToken);
Expand Down

0 comments on commit 91a4bfc

Please sign in to comment.