From: liwei Date: Mon, 6 May 2019 11:14:59 +0000 (+0800) Subject: Fix issue of Cannot read property 'hide' of undefined X-Git-Tag: submit/tizen/20190511.040220~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db0a021fda284893aa2efa8835a7e41ed7d69569;p=platform%2Fframework%2Fweb%2Fwrtjs.git Fix issue of Cannot read property 'hide' of undefined Launch an app, press return key, then issue will happen (TypeError: Cannot read property 'hide' of undefined). Reason: after press return key, WRT native side will recieve "tizen://exit",then atom::Browser::Get()->Quit() will be called, then JS side will receive window close event, then window will be removed from window list, and suspend() on JS side will also be called, then it try to hide window, but now there is no window in window list, then issue happen. Change-Id: I930f83dbbda2093304f2797656b9a6418460a822 Signed-off-by: liwei --- diff --git a/wrt_app/src/web_application.js b/wrt_app/src/web_application.js index 71b1e13b..a07fb977 100755 --- a/wrt_app/src/web_application.js +++ b/wrt_app/src/web_application.js @@ -204,6 +204,10 @@ class WebApplication { } suspend() { console.log('WebApplication : suspend'); + if (this.isTerminating) { + console.log('App has been terminated; return'); + return; + } let windows = BrowserWindow.getAllWindows(); if (!this.multitaskingSupport) { console.log('multitasking is not supported; quitting app')