diff --git a/client/lib/utils.js b/client/lib/utils.js index f5eaf25..4a8b728 100644 --- a/client/lib/utils.js +++ b/client/lib/utils.js @@ -60,7 +60,12 @@ export const getHost = function () { */ export const getDomain = function (url) { if (url.includes('localhost')) return 'localhost' - return (new URL(url)).hostname + try { + return (new URL(url)).hostname + } catch (e) { + console.error('Error extracting domai from: ',url,e) + return null + } } /**