From 0501acc82356f28e662c5ea0f884357f1fafdf48 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 22 Sep 2020 10:41:56 +0100 Subject: [PATCH] Quick fix based on test case failure. --- packages/server/src/workflows/thread.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/server/src/workflows/thread.js b/packages/server/src/workflows/thread.js index afcbd836c8..14d0beffc0 100644 --- a/packages/server/src/workflows/thread.js +++ b/packages/server/src/workflows/thread.js @@ -10,7 +10,11 @@ function cleanMustache(string) { "]": "", } let regex = new RegExp(/{{[^}}]*}}/g) - for (let match of string.match(regex)) { + let matches = string.match(regex) + if (matches == null) { + return string + } + for (let match of matches) { let baseIdx = string.indexOf(match) for (let key of Object.keys(charToReplace)) { let idxChar = match.indexOf(key)