1
0
Fork 0
mirror of synced 2024-06-14 16:35:02 +12:00

Ensure non string types are ignored when searching for HBS blocks

This commit is contained in:
Andrew Kingston 2022-10-21 10:32:32 +01:00
parent c83435a75b
commit 008d4dfd7f

View file

@ -323,6 +323,9 @@ module.exports.doesContainStrings = (template, strings) => {
* @return {string[]} The found HBS blocks.
*/
module.exports.findHBSBlocks = string => {
if (!string || typeof string !== "string") {
return []
}
let regexp = new RegExp(FIND_ANY_HBS_REGEX)
let matches = string.match(regexp)
if (matches == null) {