From bf9c0c48891632b20d521e86c2873484a676e89b Mon Sep 17 00:00:00 2001 From: Renato Atilio Date: Fri, 24 Nov 2023 15:54:16 -0300 Subject: [PATCH] DEV: ensure discovery getters don't fail with a missing #routeAttrs (#24549) --- app/assets/javascripts/discourse/app/services/discovery.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/app/services/discovery.js b/app/assets/javascripts/discourse/app/services/discovery.js index 5e8d65ccb3a..48fd873b291 100644 --- a/app/assets/javascripts/discourse/app/services/discovery.js +++ b/app/assets/javascripts/discourse/app/services/discovery.js @@ -21,19 +21,19 @@ export default class DiscoveryService extends Service { get category() { if (this.onDiscoveryRoute) { - return this.#routeAttrs.category; + return this.#routeAttrs?.category; } } get tag() { if (this.onDiscoveryRoute) { - return this.#routeAttrs.tag; + return this.#routeAttrs?.tag; } } get currentTopicList() { if (this.onDiscoveryRoute) { - return this.#routeAttrs.list; + return this.#routeAttrs?.list; } }