Skip to content

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

DEV: Ensure getter can always return without error (#18621)

David Taylor731c62504287
diff --git a/app/assets/javascripts/discourse/app/components/sidebar/section-link.js b/app/assets/javascripts/discourse/app/components/sidebar/section-link.js
index 8dd0574aa91..e68e31c0d0d 100644
--- a/app/assets/javascripts/discourse/app/components/sidebar/section-link.js
+++ b/app/assets/javascripts/discourse/app/components/sidebar/section-link.js
@@ -52,6 +52,10 @@ export default class SectionLink extends Component {
}
get prefixElementColors() {
+ if (!this.args.prefixElementColors) {
+ return;
+ }
+
const prefixElementColors = this.args.prefixElementColors.filter((color) =>
color?.slice(0, 6)
);