Do not fail on greedyTemplate when description is an object

Quick fix for not failing with an error in case of #1481
This commit is contained in:
Yohan Boniface 2023-12-22 11:03:38 +01:00
parent 417f1b9d08
commit 6890d47b91

View file

@ -176,6 +176,8 @@ L.Util.greedyTemplate = (str, data, ignore) => {
return value return value
} }
if (typeof str !== 'string') return ''
return str.replace( return str.replace(
/\{ *([^\{\}/\-]+)(?:\|("[^"]*"))? *\}/g, /\{ *([^\{\}/\-]+)(?:\|("[^"]*"))? *\}/g,
(str, key, staticFallback) => { (str, key, staticFallback) => {