FIX: prevent crash in "all" filter on features page (#1505)

* FIX: prevent crash in "all" filter on features page

* simplify
This commit is contained in:
Kris 2025-07-15 12:51:46 -04:00 committed by GitHub
parent 1b16fc876c
commit 67664029e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 6 deletions

View File

@ -66,12 +66,9 @@ class ExpandableList extends Component {
export default class AiFeaturesList extends Component {
get sortedModules() {
if (!this.args.modules || !this.args.modules.length) {
return [];
}
return this.args.modules.toSorted((a, b) =>
a.module_name.localeCompare(b.module_name)
const modules = this.args.modules?.toArray() || this.args.modules;
return [...(modules || [])].toSorted((a, b) =>
(a.module_name || "").localeCompare(b.module_name || "")
);
}