cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhigg...@apache.org
Subject git commit: CB-5118 [BlackBerry10] Add check for undefined error handler
Date Mon, 25 Nov 2013 15:51:37 GMT
Updated Branches:
  refs/heads/dev 5a4d9ad55 -> 093b084c7


CB-5118 [BlackBerry10] Add check for undefined error handler


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/093b084c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/093b084c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/093b084c

Branch: refs/heads/dev
Commit: 093b084c76938778277c6dbcb153073a8ea3f00c
Parents: 5a4d9ad
Author: Bryan Higgins <bhiggins@blackberry.com>
Authored: Mon Nov 25 10:51:50 2013 -0500
Committer: Bryan Higgins <bhiggins@blackberry.com>
Committed: Mon Nov 25 10:51:50 2013 -0500

----------------------------------------------------------------------
 www/blackberry10/requestFileSystem.js         | 12 +++++++++---
 www/blackberry10/resolveLocalFileSystemURI.js |  4 +++-
 2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/093b084c/www/blackberry10/requestFileSystem.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/requestFileSystem.js b/www/blackberry10/requestFileSystem.js
index bd07d08..e3e2d1e 100644
--- a/www/blackberry10/requestFileSystem.js
+++ b/www/blackberry10/requestFileSystem.js
@@ -27,9 +27,13 @@ module.exports = function (type, size, success, fail) {
     var cordovaFs,
         cordovaFsRoot;
     if (size >= 1000000000000000) {
-        fail(new FileError(FileError.QUOTA_EXCEEDED_ERR));
+        if (typeof fail === "function") {
+            fail(new FileError(FileError.QUOTA_EXCEEDED_ERR));
+        }
     } else if (type !== 1 && type !== 0) {
-        fail(new FileError(FileError.SYNTAX_ERR));
+        if (typeof fail === "function") {
+            fail(new FileError(FileError.SYNTAX_ERR));
+        }
     } else {
         window.webkitRequestFileSystem(type, size, function (fs) {
             cordovaFsRoot = fileUtils.createEntry(fs.root);
@@ -38,7 +42,9 @@ module.exports = function (type, size, success, fail) {
             cordovaFs._size = size;
             success(cordovaFs);
         }, function (error) {
-            fail(new FileError(error));
+            if (typeof fail === "function") {
+                fail(new FileError(error));
+            }
         });
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/093b084c/www/blackberry10/resolveLocalFileSystemURI.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/resolveLocalFileSystemURI.js b/www/blackberry10/resolveLocalFileSystemURI.js
index 4d5af61..3ede22c 100644
--- a/www/blackberry10/resolveLocalFileSystemURI.js
+++ b/www/blackberry10/resolveLocalFileSystemURI.js
@@ -48,7 +48,9 @@ module.exports = function (uri, success, fail) {
         window.webkitResolveLocalFileSystemURL(decodedURI + '/', function (entry) {
             success(fileUtils.createEntry(entry));
         }, function (e) {
-            fail(e);
+            if (typeof fail === "function") {
+                fail(e);
+            }
         });
     });
     cordova.exec(null, null, "org.apache.cordova.file", "setSandbox", [sandboxState]);


Mime
View raw message