File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -573,7 +573,15 @@ const init = async () => {
573573
574574 let getServiceDomain = async ( ) => {
575575 let serviceUrl = await settings . get ( 'serviceUrl' ) ;
576- let hostname = ( new URL ( serviceUrl ) . hostname || '' ) . toString ( ) . toLowerCase ( ) . trim ( ) ;
576+ let parsedUrl ;
577+
578+ try {
579+ parsedUrl = new URL ( serviceUrl ) ;
580+ } catch ( err ) {
581+ parsedUrl = { } ;
582+ }
583+
584+ let hostname = ( parsedUrl . hostname || '' ) . toString ( ) . toLowerCase ( ) . trim ( ) ;
577585 if ( ! hostname || net . isIP ( hostname ) || [ 'localhost' ] . includes ( hostname ) || / ( \. l o c a l | \. l a n ) $ / i. test ( hostname ) ) {
578586 return false ;
579587 }
@@ -8848,6 +8856,7 @@ init()
88488856 maxBodySize : MAX_BODY_SIZE ,
88498857 version : packageData . version
88508858 } ) ;
8859+
88518860 parentPort . postMessage ( { cmd : 'ready' } ) ;
88528861 } )
88538862 . catch ( err => {
You can’t perform that action at this time.
0 commit comments