Skip to content

Commit a99cb7c

Browse files
committed
fix(core): zoneless scheduler should check if Zone is defined before accessing it (#55118)
zoneless scheduler should check if Zone is defined before accessing it fixes #55116 PR Close #55118
1 parent 218c5bd commit a99cb7c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/change_detection/scheduling/zoneless_scheduling_impl.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export class ChangeDetectionSchedulerImpl implements ChangeDetectionScheduler {
5252
}
5353

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

0 commit comments

Comments
 (0)