From: Pawel Kaczmarczyk
Date: Thu, 1 Feb 2018 12:43:25 +0000 (+0100)
Subject: [Exif] Fix exception throwing constructor
X-Git-Tag: submit/tizen/20180228.082430~10^2
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7eed80489601463b5881e7ded91fe9fee3172f7;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Exif] Fix exception throwing constructor
Invalid values error could be thrown by ExifInformation constructor.
[Verification] tct-exif-tizen-tests passrate: 100%
Change-Id: Icee96c47faa4c8327b8dec9c9509bd9a53720e15
Signed-off-by: Pawel Kaczmarczyk
---
diff --git a/src/exif/exif_api.js b/src/exif/exif_api.js
index 3040336f..3d2cd510 100644
--- a/src/exif/exif_api.js
+++ b/src/exif/exif_api.js
@@ -243,7 +243,7 @@ ExifManager.prototype.saveExifInfo = function() {
}
]);
- if (!_isValidAbsoluteURI(args.exifInfo.uri)) {
+ if (!args.exifInfo.uri || !_isValidAbsoluteURI(args.exifInfo.uri)) {
setTimeout(function() {
native_.callIfPossible(args.errorCallback, new WebAPIException(
WebAPIException.INVALID_VALUES_ERR,
@@ -310,19 +310,10 @@ ExifManager.prototype.getThumbnail = function() {
native_.call('ExifManager_getThumbnail', {'uri': args.uri}, _callback);
};
-tizen.ExifInformation = function() {
+tizen.ExifInformation = function(exifInitDict) {
validator_.isConstructorCall(this, tizen.ExifInformation);
- var args = validator_.validateArgs(arguments, [
- {
- name: 'ExifInitDict',
- type: validator_.Types.DICTIONARY,
- optional: true,
- nullable: false
- }
- ]);
-
- var uri_ = null,
+ var uri_ = '',
width_ = null,
height_ = null,
deviceMaker_ = null,
@@ -342,14 +333,6 @@ tizen.ExifInformation = function() {
gpsTime_ = null,
userComment_ = null;
- var exifInitDict = args.ExifInitDict;
- if (exifInitDict) {
- if (exifInitDict.uri === null) {
- throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR,
- 'Parameter "uri" is required.');
- }
- }
-
Object.defineProperties(this, {
uri: {
get: function() {