Avoid exception iterating a non-existent directory