From: Chunling Ye Date: Tue, 12 Jul 2022 09:52:03 +0000 (+0800) Subject: [WRTjs]Check window when emit related event X-Git-Tag: submit/tizen/20220713.160022^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72cdd3affcbcbbc61d32cbddaf8dfa28c6f218e7;p=platform%2Fframework%2Fweb%2Fwrtjs.git [WRTjs]Check window when emit related event For Epop, if miss any configuration in TV, the app will terminate itself quickly, then 'quit->load-finish' will happen, so check window before emit event to avoid exception. Reference: https://review.tizen.org/gerrit/#/c/platform/framework/web/wrtjs/+/268326/ Change-Id: Ic7168d3a41c1c4cd3f31477259666c8f3b80a797 Signed-off-by: Chunling Ye --- diff --git a/wrt_app/src/web_application.ts b/wrt_app/src/web_application.ts index 4c025c7a..ff110c66 100644 --- a/wrt_app/src/web_application.ts +++ b/wrt_app/src/web_application.ts @@ -226,8 +226,11 @@ export class WebApplication { }); this.mainWindow.webContents.on('did-finish-load', () => { - console.log('webContents did-finish-load'); + console.log(`webContents did-finish-load, window length is ${this.windowList.length}`); this.loadFinished = true; + + if (!this.windowList.length) + return; if (this.splashShown) this.hideSplashScreen('complete');