Skip to content

Commit

Permalink
fix: TypeError: Cannot read properties of undefined (reading 'replace…
Browse files Browse the repository at this point in the history
…') (#27)
  • Loading branch information
iamsivin authored Jan 8, 2024
1 parent 52780da commit 1203c4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/canned.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const replaceVariablesInMessage = ({
variables: Variables;
}) => {
// @ts-ignore
return message.replace(MESSAGE_VARIABLES_REGEX, (_, replace) => {
return message?.replace(MESSAGE_VARIABLES_REGEX, (_, replace) => {
return variables[replace.trim()]
? variables[replace.trim().toLowerCase()]
: '';
Expand Down

0 comments on commit 1203c4d

Please sign in to comment.