From 9c2d584170f7eec6574917d34e1acb916ec8c280 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Fri, 23 Nov 2018 19:26:41 +0100 Subject: [PATCH] fix(core): update --- ts/smarttime.classes.timer.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ts/smarttime.classes.timer.ts b/ts/smarttime.classes.timer.ts index 448a98f..34754a0 100644 --- a/ts/smarttime.classes.timer.ts +++ b/ts/smarttime.classes.timer.ts @@ -61,9 +61,11 @@ export class Timer { } public pause() { - clearTimeout(this.currentTimeout); - this.currentTimeout = null; - this.pausedAt = TimeStamp.fromTimeStamp(this.startedAt); + if (this.startedAt) { + clearTimeout(this.currentTimeout); + this.currentTimeout = null; + this.pausedAt = TimeStamp.fromTimeStamp(this.startedAt); + } } public resume() {