File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -560,7 +560,7 @@ export class Device extends vscode.Disposable {
560560 service : 'sftp-ssh'
561561 } ) ;
562562 const items = new Array < ServiceItem > ( ) ;
563- let cancelSource : vscode . CancellationTokenSource ;
563+ let cancelSource : vscode . CancellationTokenSource | undefined ;
564564 let done = false ;
565565
566566 // if a device is added or removed, cancel the quick-pick
@@ -577,21 +577,21 @@ export class Device extends vscode.Disposable {
577577 }
578578 const item = new ServiceItem ( service ) ;
579579 items . push ( item ) ;
580- cancelSource . cancel ( ) ;
580+ cancelSource ? .cancel ( ) ;
581581 }
582582 } ) ;
583583 browser . on ( 'removed' , ( service ) => {
584584 const index = items . findIndex ( si => si . service === service ) ;
585585 if ( index > - 1 ) {
586586 items . splice ( index , 1 ) ;
587- cancelSource . cancel ( ) ;
587+ cancelSource ? .cancel ( ) ;
588588 }
589589 } ) ;
590590
591591 // if there is a browser error, cancel the quick-pick and show
592592 // an error message
593593 browser . on ( 'error' , err => {
594- cancelSource . cancel ( ) ;
594+ cancelSource ? .cancel ( ) ;
595595 browser . destroy ( ) ;
596596 done = true ;
597597 reject ( err ) ;
You can’t perform that action at this time.
0 commit comments