diff --git a/lib/util/template/index.ts b/lib/util/template/index.ts
index 2028177061240a04e3006b357a7ef69a0b33487d..c4717f6fe3aa5f522db88b69e78a96998df9aa96 100644
--- a/lib/util/template/index.ts
+++ b/lib/util/template/index.ts
@@ -17,10 +17,10 @@ handlebars.registerHelper(
     (context || '').replace(new RegExp(find, 'g'), replace) // TODO #12873
 );
 
-handlebars.registerHelper('lowercase', (str: string) => str.toLowerCase());
+handlebars.registerHelper('lowercase', (str: string) => str?.toLowerCase());
 
-handlebars.registerHelper('containsString', (str, subStr, options) =>
-  str.includes(subStr)
+handlebars.registerHelper('containsString', (str, subStr) =>
+  str?.includes(subStr)
 );
 
 handlebars.registerHelper({