Skip to content

Commit

Permalink
fix(core): zoneless scheduler should check if Zone is defined before …
Browse files Browse the repository at this point in the history
…accessing it (#55118)

zoneless scheduler should check if Zone is defined before accessing it

fixes #55116

PR Close #55118
  • Loading branch information
atscott committed Mar 29, 2024
1 parent 218c5bd commit a99cb7c
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -52,7 +52,9 @@ export class ChangeDetectionSchedulerImpl implements ChangeDetectionScheduler {
}

this.pendingRenderTaskId = this.taskService.add();
if (Zone?.root?.run) {
// TODO(atscott): This zone.root.run can maybe just be removed when we more
// effectively get the unpatched versions of setTimeout and rAF (#55092)
if (typeof Zone !== 'undefined' && Zone.root?.run) {
Zone.root.run(() => {
this.cancelScheduledCallback = this.schedule(() => {
this.tick(this.shouldRefreshViews);
Expand Down

0 comments on commit a99cb7c

Please sign in to comment.