[client] Fix a bug when adding file to empty dir.