[ 
https://issues.apache.org/jira/browse/CB-14181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16527542#comment-16527542
 ] 

ASF GitHub Bot commented on CB-14181:
-------------------------------------

jony89 commented on issue #235: CB-14181: (android) Fix bug - Cannot read 
property 'filesystemName' of null
URL: 
https://github.com/apache/cordova-plugin-file/pull/235#issuecomment-401337457
 
 
   @jcesarmobile it has been reproduced to me constantly on android emulator 
nexus 5
   
   device  - nexus 5
   android 7.1.1 nougat (yet will be reproduced on oreo as well I'm sure)
   cordova 7.1.0
   
   with the following code from the blog - documentation  (caused on the line 
`fs.root.getFile`
   
   ```js
           window.requestFileSystem(window.LocalFileSystem.TEMPORARY, 0, (fs) 
=> {
               console.log('file system open: ' + fs.name);
               fs.root.getFile(
                   
`${window.cordova.file.applicationStorageDirectory}${this.fileName}`, { create: 
true, exclusive: false }, (fileEntry) => {
                       console.log('fileEntry is file? ' + 
fileEntry.isFile.toString());
                       var oReq = new XMLHttpRequest();
                       // Make sure you add the domain name to the 
Content-Security-Policy <meta> element.
                       oReq.open('GET', cvURL, true);
                       // Define how you want the XHR data to come back
                       oReq.responseType = 'blob';
                       oReq.onload = (oEvent) => {
                           var blob = oReq.response; // Note: not 
oReq.responseText
                           if (blob) {
                           // Create a URL based on the blob, and set an <img> 
tag's src to it.
                               var url = window.URL.createObjectURL(blob);
                               document.getElementById('bot-img').src = url;
                               // Or read the data with a FileReader
                               var reader = new FileReader();
                               reader.addEventListener('loadend', () => {
                               // reader.result contains the contents of blob 
as text
                               });
                               reader.readAsText(blob);
                           } else console.error('we didnt get an XHR 
response!');
                       };
                       oReq.send(null);
                   }, function (err) { console.error('error getting file! ' + 
err); });
           }, function (err) { console.error('error getting persistent fs! ' + 
err); });
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Cannot read property 'filesystemName' of null
> ---------------------------------------------
>
>                 Key: CB-14181
>                 URL: https://issues.apache.org/jira/browse/CB-14181
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-file
>    Affects Versions: [email protected]
>         Environment: cordova 7.1.0
>            Reporter: ari
>            Priority: Major
>              Labels: easyfix
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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.
>  
> This is the problematic line : 
> [https://github.com/apache/cordova-plugin-file/blob/master/www/fileSystems-roots.js#L33]
> PR : https://github.com/apache/cordova-plugin-file/pull/235



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to