File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -3062,12 +3062,15 @@ class HierarchyPainter extends BasePainter {
30623062 }
30633063
30643064 return this . refreshHtml ( ) ;
3065- } ) . catch ( ( ) => {
3065+ } ) . catch ( err => {
30663066 // make CORS warning
3067- if ( isBatchMode ( ) )
3068- console . error ( `Fail to open ${ msg } - check CORS headers` ) ;
3069- else if ( ! d3_select ( '#gui_fileCORS' ) . style ( 'background' , 'red' ) . empty ( ) )
3070- setTimeout ( ( ) => d3_select ( '#gui_fileCORS' ) . style ( 'background' , '' ) , 5000 ) ;
3067+ const elem = isBatchMode ( ) ? null : d3_select ( '#gui_fileCORS' ) ;
3068+ if ( ! elem || elem . empty ( ) )
3069+ console . error ( `Fail to open ${ msg } - ${ err ?. message ?? 'check CORS headers' } ` ) ;
3070+ else {
3071+ elem . style ( 'background' , 'red' ) ;
3072+ setTimeout ( ( ) => elem . style ( 'background' , '' ) , 5000 ) ;
3073+ }
30713074 return false ;
30723075 } ) . finally ( ( ) => showProgress ( ) ) ;
30733076 }
You can’t perform that action at this time.
0 commit comments