Skip to content

Commit

Permalink
Merge pull request #1827 from andybalaam/catch-and-log-bad-url-in-hos…
Browse files Browse the repository at this point in the history
…tname

Catch and log any errors we encounter when parsing a URL to display its hostname
  • Loading branch information
marcelklehr authored Jan 14, 2025
2 parents f1df170 + 6fc0fe7 commit 460f892
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ui/views/native/Tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,12 @@ export default {
components: { DialogImportBookmarks, FaviconImage, DialogEditBookmark, DialogEditFolder, Drawer },
filters: {
hostname(url) {
return new URL(url).hostname
try {
return new URL(url).hostname
} catch (e) {
console.error(`${e}: ${url}`)
return '(bad url)'
}
}
},
data() {
Expand Down

0 comments on commit 460f892

Please sign in to comment.