From: Jakub Skowron Date: Fri, 3 Jun 2016 08:34:07 +0000 (+0200) Subject: [Account] Throw NotFoundException when accountId was not initialized X-Git-Tag: submit/tizen/20160609.034739~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9214fa3954782158147644988be23c3b2b0d891f;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Account] Throw NotFoundException when accountId was not initialized Change-Id: Iffbb30f62d2f52b3f01e43e150514b8fb953ea01 Signed-off-by: Jakub Skowron --- diff --git a/src/account/account_api.js b/src/account/account_api.js index 31c0b083..8ea2311f 100755 --- a/src/account/account_api.js +++ b/src/account/account_api.js @@ -82,6 +82,10 @@ Account.prototype.setExtendedData = function() { { name: 'value', type: types_.STRING } ]); + if( this.id === null ) { + throw new WebAPIException( WebAPIException.NOT_FOUND_ERR, "Account ID was not initialized." ); + } + var result = native_.callSync('Account_setExtendedData', { accountId: this.id, @@ -111,6 +115,10 @@ Account.prototype.getExtendedData = function() { } ]); + if( this.id === null ) { + throw new WebAPIException( WebAPIException.NOT_FOUND_ERR, "Account ID was not initialized." ); + } + var result = native_.call('Account_getExtendedData', { accountId: this.id }, function(result) { if (native_.isFailure(result)) { @@ -135,6 +143,10 @@ Account.prototype.getExtendedData = function() { { name: 'key', type: types_.STRING } ]); + if( this.id === null ) { + throw new WebAPIException( WebAPIException.NOT_FOUND_ERR, "Account ID was not initialized." ); + } + var result = native_.callSync('Account_getExtendedDataSync', { accountId: this.id,