adding local files: handle case when listFiles() returns null