From: Rafal Walczyna Date: Fri, 12 Mar 2021 12:23:06 +0000 (+0100) Subject: [ML][Single] Fix issues that came out after TCT tests X-Git-Tag: submit/tizen/20210315.104011~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f48ae3a0f3aa24b21f88a8307384ce4bf12247e7;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [ML][Single] Fix issues that came out after TCT tests - SingleShot.openModel should throw TypeError when no arguments provided [Verification] Tested in chrome-dev console Change-Id: I13b7946aa90f86ff4becccb9834b76d4f6bf6d22 Signed-off-by: Rafal Walczyna --- diff --git a/src/ml/js/ml_single.js b/src/ml/js/ml_single.js index 38192a2f..f5253038 100755 --- a/src/ml/js/ml_single.js +++ b/src/ml/js/ml_single.js @@ -64,6 +64,14 @@ MachineLearningSingle.prototype.openModel = function() { optional: true } ]); + + if (!args.has.modelPath) { + throw new WebAPIException( + WebAPIException.TYPE_MISMATCH_ERR, + 'Invalid parameter: modelPath is undefined' + ); + } + try { // get normalized URI of a file args.modelPath = tizen.filesystem.toURI(args.modelPath);