Added try catch to getUrlPreview
This commit is contained in:
parent
13c4e14762
commit
618602dc4f
1 changed files with 7 additions and 3 deletions
|
@ -423,9 +423,13 @@ function Embed({ link }) {
|
|||
let unmounted = false;
|
||||
|
||||
async function getUrlPreview() {
|
||||
try {
|
||||
const info = await mx.getUrlPreview(link, 0);
|
||||
if (unmounted) return;
|
||||
setUrlPreviewInfo(info);
|
||||
} catch {
|
||||
setUrlPreviewInfo();
|
||||
}
|
||||
}
|
||||
|
||||
getUrlPreview();
|
||||
|
|
Loading…
Reference in a new issue