File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,18 @@ class SiteCreator extends LitElement {
3131 const value = input . value . toLowerCase ( ) ;
3232 input . value = value ; // Update the input field with lowercase value
3333
34- const url = new URL ( value ) ;
35- const org = url . pathname . split ( '/' ) [ 1 ] ;
36- const repo = url . pathname . split ( '/' ) [ 2 ] ;
34+ try {
35+ const url = new URL ( value ) ;
36+ const org = url . pathname . split ( '/' ) [ 1 ] ;
37+ const repo = url . pathname . split ( '/' ) [ 2 ] ;
3738
38- if ( org && repo && url . hostname === 'github.com' ) {
39- this . _status = null ;
40- this . _data = { org, repo } ;
39+ if ( org && repo && url . hostname === 'github.com' ) {
40+ this . _status = null ;
41+ this . _data = { org, repo } ;
42+ }
43+ } catch ( error ) {
44+ // We don't care about form change errors so long as the value is a url
45+ // upon form submission.
4146 }
4247 }
4348
You can’t perform that action at this time.
0 commit comments