Fix weird bug… I don't even know why url is undefined

This commit is contained in:
Lim Chee Aun 2023-03-12 19:23:42 +08:00
parent c6957f6967
commit 13201260d6

View file

@ -1565,6 +1565,7 @@ function _unfurlMastodonLink(instance, url) {
}
function nicePostURL(url) {
if (!url) return;
const urlObj = new URL(url);
const { host, pathname } = urlObj;
const path = pathname.replace(/\/$/, '');