From c7eed80489601463b5881e7ded91fe9fee3172f7 Mon Sep 17 00:00:00 2001
From: Pawel Kaczmarczyk
Date: Thu, 1 Feb 2018 13:43:25 +0100
Subject: [PATCH] [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
---
src/exif/exif_api.js | 23 +++--------------------
1 file changed, 3 insertions(+), 20 deletions(-)
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() {
--
2.34.1