ebidel/filer.js

mkdir creates "null" folder.

Opened this issue · 2 comments

I'm not sure if this is a bug in filer.js because it's kind of obvious:

When I use mkdir() it works fine, but inside the last folder there is another folder called "null". In filer.js (line ~553) there is an if-statement if(folders.length && folderParts.length != 1). If folders.length is 1 it's the last time createDir(dirEntry, folders.slice(1)) is going to be called. But the parameter folders.slice(1) removes the last element and calls createDir() with an empty array folders. Now folders[0] is undefined and I think that causes the "null"-folder - I just wonder why its name isn't undefined instead.
In addition that "null" folder is passed as parameter to successCallback function. So in successCallback this.name is null.
But it works for me when I change the line to if(folders.length > 1 && folderParts.length != 1).

Well, I saw someone submitted an issue about the mkdir function but it has been another problem. I wonder if that person didn't run into that problem or just hasn't noticed it. But wait, I'll check that issue again, maybe this is the reason for the other one...

What is the exact call you're using? Is this when passing a path?

I don't remember exactly but from what I wrote I think this happened when I pass a path, yes. The function creates one folder after the other and in the end there is one too much.