[TIMOB-26149] Android: Ti.Filesystem.File#getDirectoryListing() does not return null for file/non-existent directory
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-08-24T01:29:51.000+0000 |
| Affected Version/s | Release 7.3.0 |
| Fix Version/s | Release 7.5.0 |
| Components | Android |
| Labels | parity |
| Reporter | Christopher Williams |
| Assignee | Christopher Williams |
| Created | 2018-06-22T15:13:52.000+0000 |
| Updated | 2018-08-24T01:29:54.000+0000 |
Description
According to our docs, and our iOS behavior - if Ti.FIlesystem.File#getDirectoryListing() is called on a file or a directory that does not exist, it should return null. On Android it returns an empty array.
https://github.com/appcelerator/titanium_mobile/pull/10128
*Closing ticket.* Verified fix in SDK version:
7.4.0.v20180810061237.getDirectoryListingno longer returns an empty array and now returnsnull. *FR Passed (Test Steps):*Created a new application using Titanium
Added the following code in to the application
var nonExistentDir = Ti.Filesystem.getFile('madeup'); Ti.API.info(nonExistentDir.getDirectoryListing()); // Should print 'null' var file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'app.js'); Ti.API.info(file.getDirectoryListing()); // Should print 'null'Ran the application
Able to see
nullprinted in the console unlike previously where an empty array was printed.*Test Environment**Edit* SDK Version:
7.4.0.v20180813131247was used.