From 27232751894e8fa40b73d596d251c5cb341cb50b Mon Sep 17 00:00:00 2001 From: Saurav Date: Fri, 9 Jul 2021 17:50:50 +0530 Subject: [PATCH] Fix crashes in using delay map --- components/typewriter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/typewriter.js b/components/typewriter.js index 1c290d8..4e94fdd 100644 --- a/components/typewriter.js +++ b/components/typewriter.js @@ -101,7 +101,7 @@ export default class TypeWriter extends Component { if (delayMap) { delayMap.forEach(({ at, delay }) => { - if (at === visibleChars || (currentToken && currentToken.match(at)) ) { + if (at === visibleChars || (currentToken && currentToken?.match(at)) ) { timeout += delay; } });