From: taekeun.kang Date: Wed, 11 May 2016 02:18:51 +0000 (+0900) Subject: [PackageManager] add code to check if each property in progressCallback is available X-Git-Tag: accepted/tizen/common/20160512.144010~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f496cb7ba5eb1048067e7038defc4ee282c5eae7;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [PackageManager] add code to check if each property in progressCallback is available Change-Id: I83300fbd159d603886dfb9425898db60f18c510c Signed-off-by: taekeun.kang --- diff --git a/src/package/package_api.js b/src/package/package_api.js index 706aa5a..87c45d1 100644 --- a/src/package/package_api.js +++ b/src/package/package_api.js @@ -160,9 +160,13 @@ var PackageManagerInstall = function() { nativeParam, function(result) { if (result.status == 'progress') { - args.progressCallback.onprogress(result.id, result.progress); + if (args.progressCallback.onprogress) { + args.progressCallback.onprogress(result.id, result.progress); + } } else if (result.status == 'complete') { - args.progressCallback.oncomplete(result.id); + if (args.progressCallback.oncomplete) { + args.progressCallback.oncomplete(result.id); + } } else if (result.status == 'error') { var err = result['error']; if (err) { @@ -203,9 +207,13 @@ var PackageManagerUninstall = function() { nativeParam, function(result) { if (result.status == 'progress') { - args.progressCallback.onprogress(result.id, result.progress); + if (args.progressCallback.onprogress) { + args.progressCallback.onprogress(result.id, result.progress); + } } else if (result.status == 'complete') { - args.progressCallback.oncomplete(result.id); + if (args.progressCallback.oncomplete) { + args.progressCallback.oncomplete(result.id); + } } else if (result.status == 'error') { var err = result['error']; if (err) {