You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Fix soft-crash on bad permalinks
Fixes https://github.com/vector-im/riot-web/issues/12880
This commit is contained in:
@@ -200,6 +200,7 @@ 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)
|
||||||
|
try {
|
||||||
const permalink = parsePermalink(href);
|
const permalink = parsePermalink(href);
|
||||||
if (permalink && permalink.userId) {
|
if (permalink && permalink.userId) {
|
||||||
return {
|
return {
|
||||||
@@ -208,6 +209,9 @@ matrixLinkify.options = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// OK fine, it's not actually a permalink
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "userid":
|
case "userid":
|
||||||
|
|||||||
Reference in New Issue
Block a user