File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -72,13 +72,15 @@ export function hub(chrome) {
7272
7373 function forgetApp ( targetWindow ) {
7474 try {
75- const { appId, token } = appWindows . get ( targetWindow ) ;
76- debug ( 'Forgetting app %o' , appId ) ;
77- appPongs
78- . get ( token )
79- . timeoutIds . forEach ( timeoutId => clearTimeout ( timeoutId ) ) ;
80- appPongs . delete ( token ) ;
81- appWindows . delete ( targetWindow ) ;
75+ const { appId, token } = appWindows . get ( targetWindow ) || { } ;
76+ if ( appId && token ) {
77+ debug ( 'Forgetting app %o' , appId ) ;
78+ appPongs
79+ . get ( token )
80+ . timeoutIds . forEach ( timeoutId => clearTimeout ( timeoutId ) ) ;
81+ appPongs . delete ( token ) ;
82+ appWindows . delete ( targetWindow ) ;
83+ }
8284 } catch ( error ) {
8385 debug ( "App couldn't be forgotten in %o - %o" , targetWindow , error ) ;
8486 }
You can’t perform that action at this time.
0 commit comments