Skip to content

Commit

Permalink
Increased support level to v9; fixed exception while the canvas is in…
Browse files Browse the repository at this point in the history
…itializing
  • Loading branch information
illandril committed Jan 14, 2022
1 parent d43d0a8 commit 3e6b4f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"library": "false",
"manifestPlusVersion": "1.2.0",
"minimumCoreVersion": "0.8.5",
"compatibleCoreVersion": "0.8.9",
"compatibleCoreVersion": "9",
"type": "module",
"author": "Joe Spandrusyszyn (illandril)",
"authors": [
Expand Down Expand Up @@ -64,4 +64,4 @@
"url": "https://github.com/illandril/FoundryVTT-chat-enhancements/raw/master/screenshots/example-preview.png"
}
]
}
}
6 changes: 6 additions & 0 deletions module/scripts/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { log } from './module.js';

function getThisSceneTokenObj(speaker) {
let token = getTokenObj(speaker.token);
if (!token) {
Expand All @@ -21,6 +23,10 @@ function getThisSceneTokenObjForActor(actorID) {
}

function getTokenObj(id) {
if(!canvas.ready) {
log.info(`getTokenObj(${id}) bailed - canvas is not ready yet`);
return undefined;
}
return canvas.tokens.get(id);
}

Expand Down

0 comments on commit 3e6b4f0

Please sign in to comment.