Skip to content

Commit

Permalink
Fix missing template handling (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkahvi authored Mar 16, 2022
1 parent cd95b93 commit db90f16
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion module/hooks/inspect-template.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ export async function inspectSystemTemplate() {
if (Object.keys(CONFIG[type].sheetClasses[templateSubtype] ?? {}).length === 0)
reportData.unregistered[type].add(templateSubtype);

templateData[templateSubtype].templates.forEach(includedSubTemplate => { // ex. Actor.type.templates.*
if (templateData[templateSubtype] === undefined) {
console.warn(type, "subtype", templateSubtype, "lacks definition");
reportData.untemplated[type].add(templateSubtype);
return;
}

templateData[templateSubtype].templates?.forEach(includedSubTemplate => { // ex. Actor.type.templates.*
// Check for used or undefined templates
if (includedSubTemplate in templateData.templates)
reportData.used[type].add(includedSubTemplate);
Expand Down

0 comments on commit db90f16

Please sign in to comment.