[Download] Fixed type mismache error
authorjiajia qin <jiajia.qin@intel.com>
Wed, 19 Feb 2014 16:33:10 +0000 (00:33 +0800)
committerjiajia qin <jiajia.qin@intel.com>
Thu, 20 Feb 2014 09:18:37 +0000 (17:18 +0800)
download/download_api.js

index 3a73693..259dc86 100644 (file)
@@ -240,7 +240,9 @@ exports.start = function(request, listener) {
     throw new tizen.WebAPIException(tizen.WebAPIException.TYPE_MISMATCH_ERR);
   }
   requests[request.uid] = request;
-  if (listener !== null) {
+  // If listener is equal to 'undefined', 'listener !== null' is still true.
+  // So change condition 'listener !== null' to 'listener != null'.
+  if (listener != null) {
     ensureType(listener, 'object');
     exports.setListener(request.uid, listener);
   }