From 549dabb34c87447df7d5a4ef6bd443ce766de623 Mon Sep 17 00:00:00 2001 From: Matheus Clemente Date: Thu, 4 Jan 2024 04:28:54 -0300 Subject: [PATCH] Update about-face.js Fix #72. --- about-face.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/about-face.js b/about-face.js index 1fe346d..a856dea 100644 --- a/about-face.js +++ b/about-face.js @@ -67,8 +67,12 @@ Hooks.on("canvasReady", async () => { }); Hooks.on("preCreateToken", onPreCreateToken); Hooks.on("preUpdateToken", onPreUpdateToken); -Hooks.on("createToken", (tokenDocument, options, userId) => drawAboutFaceIndicator(tokenDocument.object)); -Hooks.on("updateToken", (tokenDocument, changes, options, userId) => drawAboutFaceIndicator(tokenDocument.object)); +Hooks.on("createToken", (tokenDocument, options, userId) => { + if (tokenDocument.object) drawAboutFaceIndicator(tokenDocument.object); +}); +Hooks.on("updateToken", (tokenDocument, changes, options, userId) => { + if (tokenDocument.object) drawAboutFaceIndicator(tokenDocument.object); +}); Hooks.on("refreshToken", (token, options) => { if (options.redrawEffects) drawAboutFaceIndicator(token); });