Skip to content

Commit

Permalink
added try/catch to handle undefined codeTemplates.codeTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelLeeHobbs committed Mar 1, 2021
1 parent a1ae6f0 commit 8544518
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/analyzers/codeTemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ const handleCodeTemplate = ({codeTemplate, enabledChannelIds, id, name}) => {

const handleCodeTemplates = (codeTemplateLibrary) => {
const {id: [id], name: [name], enabledChannelIds: [{string: enabledChannelIds} = _ids], codeTemplates: [codeTemplates]} = codeTemplateLibrary
codeTemplates.codeTemplate.forEach(codeTemplate => handleCodeTemplate({codeTemplate, enabledChannelIds, id, name}))
try {
codeTemplates.codeTemplate.forEach(codeTemplate => handleCodeTemplate({codeTemplate, enabledChannelIds, id, name}))
} catch (e) {
console.error(`Failed to parse code template!`, e)
console.debug(codeTemplateLibrary)
}
}

const checkScript = ({script, channelName, channelID, transformerType, transformerStep, transformerName}) => {
Expand Down

0 comments on commit 8544518

Please sign in to comment.