Skip to content

Commit 460f892

Browse files
authored
Merge pull request #1827 from andybalaam/catch-and-log-bad-url-in-hostname
Catch and log any errors we encounter when parsing a URL to display its hostname
2 parents f1df170 + 6fc0fe7 commit 460f892

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ui/views/native/Tree.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,12 @@ export default {
436436
components: { DialogImportBookmarks, FaviconImage, DialogEditBookmark, DialogEditFolder, Drawer },
437437
filters: {
438438
hostname(url) {
439-
return new URL(url).hostname
439+
try {
440+
return new URL(url).hostname
441+
} catch (e) {
442+
console.error(`${e}: ${url}`)
443+
return '(bad url)'
444+
}
440445
}
441446
},
442447
data() {

0 commit comments

Comments
 (0)