[Download] Fix network type checking
authorDeqing Huang <deqing.huang@intel.com>
Fri, 6 Dec 2013 10:17:39 +0000 (18:17 +0800)
committerDeqing Huang <deqing.huang@intel.com>
Fri, 6 Dec 2013 10:17:39 +0000 (18:17 +0800)
It is ok to set networktype to null, as it is optional.
And no need to throw exception if trying to set invalid value
(according to spec).

download/download_api.js

index fb0691e..bea1094 100644 (file)
@@ -208,10 +208,8 @@ tizen.DownloadRequest = function(url, destination, fileName, networkType) {
   Object.defineProperty(this, 'networkType', {
     get: function() { return this.networkTypeValue; },
     set: function(type) {
-      if (type in AllowDownloadOnNetworkType) {
+      if (type === null || type in AllowDownloadOnNetworkType) {
         this.networkTypeValue = type;
-      } else {
-        throw new tizen.WebAPIException(tizen.WebAPIException.INVALID_VALUES_ERR);
       }
     }
   });