From a86eceb7d4f8650b2b62c4d8450e0c68a3e4af8c Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Fri, 10 Dec 2021 13:55:13 +0100 Subject: [PATCH] fix: default empty string for replace --- lib/util/template/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/util/template/index.ts b/lib/util/template/index.ts index a449097b3f..92b78ecedc 100644 --- a/lib/util/template/index.ts +++ b/lib/util/template/index.ts @@ -13,7 +13,8 @@ handlebars.registerHelper('stringToPrettyJSON', (input: string): string => // istanbul ignore next handlebars.registerHelper( 'replace', - (find, replace, context) => context.replace(new RegExp(find, 'g'), replace) // TODO #12873 + (find, replace, context) => + (context || '').replace(new RegExp(find, 'g'), replace) // TODO #12873 ); export const exposedConfigOptions = [ -- GitLab