Skip to content

A platform for community discussion. Free, open, simple.

DEV: Prevent error filtering the sidebar items when the section text is empty (#27957)

Sérgio Saquetime1f638b0a399
diff --git a/app/assets/javascripts/discourse/app/components/sidebar/api-sections.gjs b/app/assets/javascripts/discourse/app/components/sidebar/api-sections.gjs
index 7a7996ccbd9..58fe7861537 100644
--- a/app/assets/javascripts/discourse/app/components/sidebar/api-sections.gjs
+++ b/app/assets/javascripts/discourse/app/components/sidebar/api-sections.gjs
@@ -65,7 +65,7 @@ function prepareSidebarSectionClass(Section) {
return this.links;
}
- if (this.text.toLowerCase().match(this.sidebarState.sanitizedFilter)) {
+ if (this.text?.toLowerCase()?.match(this.sidebarState.sanitizedFilter)) {
return this.links;
}