Skip to content

Commit

Permalink
CB-14181: (android) Fix bug - Cannot read property 'filesystemName' o…
Browse files Browse the repository at this point in the history
…f 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
  • Loading branch information
jony89 authored and jcesarmobile committed Jun 30, 2018
1 parent 5e12b5e commit cc3aedb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions www/fileSystems-roots.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down

0 comments on commit cc3aedb

Please sign in to comment.