mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 02:05:45 +03:00
Merge pull request #4280 from matrix-org/dbkr/fix_permalink_crash
Fix soft-crash on bad permalinks
This commit is contained in:
commit
5986bbc561
1 changed files with 11 additions and 7 deletions
|
@ -200,13 +200,17 @@ matrixLinkify.options = {
|
|||
switch (type) {
|
||||
case "url": {
|
||||
// intercept local permalinks to users and show them like userids (in userinfo of current room)
|
||||
const permalink = parsePermalink(href);
|
||||
if (permalink && permalink.userId) {
|
||||
return {
|
||||
click: function(e) {
|
||||
matrixLinkify.onUserClick(e, permalink.userId);
|
||||
},
|
||||
};
|
||||
try {
|
||||
const permalink = parsePermalink(href);
|
||||
if (permalink && permalink.userId) {
|
||||
return {
|
||||
click: function(e) {
|
||||
matrixLinkify.onUserClick(e, permalink.userId);
|
||||
},
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
// OK fine, it's not actually a permalink
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue