Merge pull request #4280 from matrix-org/dbkr/fix_permalink_crash
Fix soft-crash on bad permalinkspull/21833/head
commit
5986bbc561
|
@ -200,13 +200,17 @@ matrixLinkify.options = {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "url": {
|
case "url": {
|
||||||
// intercept local permalinks to users and show them like userids (in userinfo of current room)
|
// intercept local permalinks to users and show them like userids (in userinfo of current room)
|
||||||
const permalink = parsePermalink(href);
|
try {
|
||||||
if (permalink && permalink.userId) {
|
const permalink = parsePermalink(href);
|
||||||
return {
|
if (permalink && permalink.userId) {
|
||||||
click: function(e) {
|
return {
|
||||||
matrixLinkify.onUserClick(e, permalink.userId);
|
click: function(e) {
|
||||||
},
|
matrixLinkify.onUserClick(e, permalink.userId);
|
||||||
};
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// OK fine, it's not actually a permalink
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue