From 876fdab031d6045943037decfa2d342df3a4ef7b Mon Sep 17 00:00:00 2001 From: ztimson Date: Sun, 21 Apr 2019 18:24:48 -0400 Subject: [PATCH] Added null check --- src/app/components/typewriter/typewriter.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/typewriter/typewriter.component.ts b/src/app/components/typewriter/typewriter.component.ts index 502ec83..c8982a6 100644 --- a/src/app/components/typewriter/typewriter.component.ts +++ b/src/app/components/typewriter/typewriter.component.ts @@ -14,7 +14,7 @@ export class TypewriterComponent { @Input() set text(text: string) { - this.output = timer(this.delay, this.speed).pipe(filter(n => n <= text.length), map(n => text.slice(0, n))); + this.output = timer(this.delay, this.speed).pipe(filter(n => n <= (text.length || 0)), map(n => text.slice(0, n))); } output: Observable;