Skip to content

Commit d2f53bc

Browse files
authored
protect from null href
1 parent cb27750 commit d2f53bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/url.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,11 @@ export function parseYoutubeStart (t) {
9292
/**
9393
* check if it's an embed URL and if there's an available proxy for it
9494
* @param {string} href
95-
* @param {string} provider
95+
* @param {string} [provider]
9696
* @returns {Object|null} if a proxy is available, returns an object with provider, service and href
9797
*/
9898
export function proxyEmbedUrl (href, provider) {
99+
if (!href) return null
99100
if (!provider) {
100101
provider = parseEmbedUrl(href)?.provider
101102
}

0 commit comments

Comments
 (0)