Skip to content

Commit

Permalink
handle parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Jan 7, 2025
1 parent a5b1852 commit 06370a8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/node_modules/pouchdb-adapter-http/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ function hasUrlPrefix(opts) {
if (!opts.prefix) {
return false;
}
const protocol = new URL(opts.prefix).protocol;
return protocol === 'http:' || protocol === 'https:';

try {
const protocol = new URL(opts.prefix).protocol;
return protocol === 'http:' || protocol === 'https:';
} catch (err) {
return false;
}
}

// Get all the information you possibly can about the URI given by name and
Expand Down

0 comments on commit 06370a8

Please sign in to comment.