From cc3aedb0abb220b4c4ede7c48af5e578fd071690 Mon Sep 17 00:00:00 2001 From: jony89 Date: Sat, 30 Jun 2018 21:49:04 +0300 Subject: [PATCH] CB-14181: (android) Fix bug - Cannot read property 'filesystemName' of null (#235) CB-14181: (android) fix: Cannot read property 'filesystemName' of null fix error : Error in Success callbackId: File1539060614 : TypeError: Cannot read property 'filesystemName' of null cordova.js:314 Uncaught TypeError: Cannot read property 'filesystemName' of null The `fsRoot` might be null. reproduced with latest cordova on android emulator. * fix: eslint --- www/fileSystems-roots.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/fileSystems-roots.js b/www/fileSystems-roots.js index 9a3fc7a08..b15adbd75 100644 --- a/www/fileSystems-roots.js +++ b/www/fileSystems-roots.js @@ -30,8 +30,10 @@ require('./fileSystems').getFs = function (name, callback) { fsMap = {}; for (var i = 0; i < response.length; ++i) { var fsRoot = response[i]; - var fs = new FileSystem(fsRoot.filesystemName, fsRoot); - fsMap[fs.name] = fs; + if (fsRoot) { + var fs = new FileSystem(fsRoot.filesystemName, fsRoot); + fsMap[fs.name] = fs; + } } callback(fsMap[name]); }