Ensure non string types are ignored when searching for HBS blocks
This commit is contained in:
parent
3d2bf594bd
commit
738c98eb47
|
@ -323,6 +323,9 @@ module.exports.doesContainStrings = (template, strings) => {
|
||||||
* @return {string[]} The found HBS blocks.
|
* @return {string[]} The found HBS blocks.
|
||||||
*/
|
*/
|
||||||
module.exports.findHBSBlocks = string => {
|
module.exports.findHBSBlocks = string => {
|
||||||
|
if (!string || typeof string !== "string") {
|
||||||
|
return []
|
||||||
|
}
|
||||||
let regexp = new RegExp(FIND_ANY_HBS_REGEX)
|
let regexp = new RegExp(FIND_ANY_HBS_REGEX)
|
||||||
let matches = string.match(regexp)
|
let matches = string.match(regexp)
|
||||||
if (matches == null) {
|
if (matches == null) {
|
||||||
|
|
Loading…
Reference in New Issue