Skip to content

Commit

Permalink
Fix null properties in resolve_tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
mattesCZ committed Oct 25, 2023
1 parent 751943c commit 926ded2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/resolve_tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
export function resolveTokens(
properties: {
readonly [x: string]: unknown;
},
} | null,
text: string
): string {
return text.replace(/{([^{}]+)}/g, (match, key: string) => {
return key in properties ? String(properties[key]) : '';
return properties && key in properties ? String(properties[key]) : '';
});
}

0 comments on commit 926ded2

Please sign in to comment.