Resolve JS errors in electron apps 44/214144/3
authorsurya.kumar7 <surya.kumar7@samsung.com>
Thu, 19 Sep 2019 15:15:04 +0000 (20:45 +0530)
committersurya.kumar7 <surya.kumar7@samsung.com>
Thu, 19 Sep 2019 15:15:18 +0000 (20:45 +0530)
webApplication object was used without guard in electron
apps

Change-Id: I86aa1b57e4e964be5041ba96f1488a9aaab2e3d2
Signed-off-by: surya.kumar7 <surya.kumar7@samsung.com>
wrt_app/src/runtime.js

index dc69391..5fac1f4 100755 (executable)
@@ -168,11 +168,13 @@ class Runtime {
         });
         wrt.on('resume', function() {
             console.log('resume');
-            _this.webApplication.resume(_this.addonManager.evt_emitter_);
+            if (_this.webApplication)
+                _this.webApplication.resume(_this.addonManager.evt_emitter_);
         });
         wrt.on('low-memory', function() {
             console.log('low-memory');
-            _this.webApplication.lowMemory();
+            if (_this.webApplication)
+                _this.webApplication.lowMemory();
         });
         wrt.on('wgt-installed', function(event, path) {
             console.log('wgt-installed at ' + path);