Skip to content

Commit 9112ce2

Browse files
authored
Avoiding accessing undefined tributeValues #26461 (#26462)
Backport #26461
1 parent 2bdc38e commit 9112ce2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

web_src/js/features/tribute.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function makeCollections({mentions, emoji}) {
3131

3232
if (mentions) {
3333
collections.push({
34-
values: window.config.tributeValues,
34+
values: window.config.tributeValues ?? [],
3535
requireLeadingSpace: true,
3636
menuItemTemplate: (item) => {
3737
return `

web_src/js/utils/match.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function matchMention(queryText) {
3232

3333
// results is a map of weights, lower is better
3434
const results = new Map();
35-
for (const obj of window.config.tributeValues) {
35+
for (const obj of window.config.tributeValues ?? []) {
3636
const index = obj.key.toLowerCase().indexOf(query);
3737
if (index === -1) continue;
3838
const existing = results.get(obj);

0 commit comments

Comments
 (0)