diff --git a/src/modules/processing/services/snapchat.js b/src/modules/processing/services/snapchat.js index bcafb82a..0a6ce206 100644 --- a/src/modules/processing/services/snapchat.js +++ b/src/modules/processing/services/snapchat.js @@ -64,7 +64,7 @@ export default async function(obj) { let pathname; if (obj.url.hostname === 't.snapchat.com' && obj.shortLink) { const link = await getRedirectingURL(`https://t.snapchat.com/${obj.shortLink}`); - if (link && !link.startsWith('https://www.snapchat.com/')) return { error: 'ErrorCouldntFetch' }; + if (!link || !link.startsWith('https://www.snapchat.com/')) return { error: 'ErrorCouldntFetch' }; pathname = new URL(link).pathname; } diff --git a/src/modules/sub/utils.js b/src/modules/sub/utils.js index 75ac305e..4f4fe529 100644 --- a/src/modules/sub/utils.js +++ b/src/modules/sub/utils.js @@ -136,7 +136,7 @@ export function cleanHTML(html) { return clean } export async function getRedirectingURL(url) { - return await fetch(url, { redirect: 'manual' }).then((r) => { + return fetch(url, { redirect: 'manual' }).then((r) => { if ([301, 302, 303].includes(r.status) && r.headers.has('location')) return r.headers.get('location'); }).catch(() => null);