mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
Avoiding accessing undefined mentionValues (#26461)
The `window.config.mentionValues` might be undefined: ``` {{if or .Participants .Assignees .MentionableTeams}} mentionValues: ... {{end}} ```
This commit is contained in:
@ -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.mentionValues) {
|
||||
for (const obj of window.config.mentionValues ?? []) {
|
||||
const index = obj.key.toLowerCase().indexOf(query);
|
||||
if (index === -1) continue;
|
||||
const existing = results.get(obj);
|
||||
|
Reference in New Issue
Block a user