Browse Source

Avoiding accessing undefined tributeValues #26461 (#26462)

Backport #26461
tags/v1.20.3
wxiaoguang 10 months ago
parent
commit
9112ce22a4
No account linked to committer's email address
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      web_src/js/features/tribute.js
  2. 1
    1
      web_src/js/utils/match.js

+ 1
- 1
web_src/js/features/tribute.js View File

@@ -31,7 +31,7 @@ function makeCollections({mentions, emoji}) {

if (mentions) {
collections.push({
values: window.config.tributeValues,
values: window.config.tributeValues ?? [],
requireLeadingSpace: true,
menuItemTemplate: (item) => {
return `

+ 1
- 1
web_src/js/utils/match.js View File

@@ -32,7 +32,7 @@ export function matchMention(queryText) {

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

Loading…
Cancel
Save