Removing folder part only if the size permits it

Cordova was complaining because of rootDir.getDirectory when folders[0] was null...