From 8fa7c27491a9d1ec61790052943d0c1514c0a7b9 Mon Sep 17 00:00:00 2001 From: Jamie Wilson Date: Fri, 25 Oct 2024 13:28:41 -0400 Subject: [PATCH] DEV: Check for presence of currentRoute.attributes It appears that the `discovery.custom` route may not (always?) have attributes set, which can cause an error here. --- assets/javascripts/discourse/components/ai-gist-disclosure.gjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/javascripts/discourse/components/ai-gist-disclosure.gjs b/assets/javascripts/discourse/components/ai-gist-disclosure.gjs index db371fd34..7534d6c2c 100644 --- a/assets/javascripts/discourse/components/ai-gist-disclosure.gjs +++ b/assets/javascripts/discourse/components/ai-gist-disclosure.gjs @@ -7,7 +7,7 @@ export default class AiGistDisclosure extends Component { @service router; get shouldShow() { - return this.router.currentRoute.attributes.list?.topics?.some( + return this.router.currentRoute.attributes?.list?.topics?.some( (topic) => topic.ai_topic_gist ); }