Avoiding accessing undefined tributeValues #26461 (#26462)

Backport #26461
This commit is contained in:
wxiaoguang authored and GitHub committed 2023-08-12 10:30:29 +02:00
1 parent 2bdc38e592
commit 9112ce22a4
2 files changed
+2 -2

No files matched your search

+1 -1
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);