diff --git a/lib/variables.js b/lib/variables.js index 554c504..15c4ccc 100644 --- a/lib/variables.js +++ b/lib/variables.js @@ -15,6 +15,11 @@ const uniqueString = (string) => { */ const replaceVariables = (el,value) => { + // Guard against undefined or non-string values + if (typeof value !== 'string') { + return value || ''; + } + // find non-nested css function calls // eg: rgb(...), drop-shadow(...) let funcReg = /([a-z\-]+)\s*\(\s*([^\(\)]*?)\s*(?:,\s*([^\(\)]*?)\s*)?\s*\)/i;