From 313f726d477e19eb61fb8e3add3f08f859244261 Mon Sep 17 00:00:00 2001 From: patrickpircher Date: Wed, 3 Jan 2024 12:57:19 +0100 Subject: [PATCH] fix --- ember_debug/route-debug.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ember_debug/route-debug.js b/ember_debug/route-debug.js index 45624b801a..9cdfea5c7f 100644 --- a/ember_debug/route-debug.js +++ b/ember_debug/route-debug.js @@ -36,7 +36,10 @@ export default class RouteDebug extends DebugPort { } get router() { - if (this.namespace?.owner.isDestroyed) { + if ( + this.namespace?.owner.isDestroyed || + this.namespace?.owner.isDestroying + ) { return null; } return this.namespace?.owner.lookup('router:main'); @@ -74,6 +77,12 @@ export default class RouteDebug extends DebugPort { } get routeTree() { + if ( + this.namespace?.owner.isDestroyed || + this.namespace?.owner.isDestroying + ) { + return null; + } if (!this._cachedRouteTree && this.router) { const router = this.router; const routerLib = router._routerMicrolib || router.router;