| 280 | 280 | * @returns {string[]} An array of character names representing the members of the group. |
| 281 | 281 | */ |
| 282 | 282 | export function getGroupNames() { |
| 283 | | - const groupMembers = selected_group ? groups.find(x => x.id == selected_group)?.members : null; |
| 283 | + if (!selected_group) { |
| 284 | + return []; |
| 285 | + } |
| 286 | + const groupMembers = groups.find(x => x.id == selected_group)?.members; |
| 284 | 287 | return Array.isArray(groupMembers) |
| 285 | 288 | ? groupMembers.map(x => characters.find(y => y.avatar === x)?.name).filter(x => x) |
| 286 | 289 | : []; |