Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit b3ffd91

Browse files
WliuWliu
Wliu
authored and
Wliu
committed
Do not throw when attempting to parse URLs
1 parent 1082c77 commit b3ffd91

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/github-file.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,9 @@ export default class GitHubFile {
272272
const {host} = parseURL(url)
273273

274274
return host === 'gist.github.com'
275-
} finally {}
275+
} catch (error) {
276+
return false
277+
}
276278
}
277279

278280
isGitHubWikiURL (url) {
@@ -288,7 +290,9 @@ export default class GitHubFile {
288290
const {host} = parseURL(url)
289291

290292
return host === 'bitbucket.org'
291-
} finally {}
293+
} catch (error) {
294+
return false
295+
}
292296
}
293297

294298
// Internal

0 commit comments

Comments
 (0)