Skip to content

Commit

Permalink
Fix adding time without timer
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Jan 7, 2024
1 parent 1f9006c commit 045efd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scripts/components/mixins/main-timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ export default class MainTimer {
* @param {number} timeS Time in seconds.
*/
addExtraTime(timeS) {
if (typeof timeS !== 'number' || timeS < 1) {
if (typeof timeS !== 'number' || timeS < 1 || !this.timer) {
return;
}

this.timer?.setTime(this.timer?.getTime() + timeS * 1000);
this.timer.setTime(this.timer.getTime() + timeS * 1000);
this.toolbar.setStatusContainerStatus(
'timer',
{ value: Timer.toTimecode(this.timer.getTime()) }
Expand Down

0 comments on commit 045efd7

Please sign in to comment.