# DirectoryIterator bug with invalid (empty path) File?

**URL:** <https://forum.juce.com/t/directoryiterator-bug-with-invalid-empty-path-file/19523>\
**Category:** Windows\
**Created:** [October 18, 2016, 12:11pm UTC](https://forum.juce.com/t/directoryiterator-bug-with-invalid-empty-path-file/19523 "2016-10-18T12:11:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [October 18, 2016, 12:11pm UTC](https://forum.juce.com/t/directoryiterator-bug-with-invalid-empty-path-file/19523/1 "2016-10-18T12:11:16Z")

</div>

I expect DirectoryIterator::next() to return false with a non existing file, but it returns true on windows :

```
File f;
DirectoryIterator iter (f, true, "*", File::findFiles);
jassert (! iter.next()); 

```

am I missing something simple, or is that a bug?

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [October 19, 2016, 9:21am UTC](https://forum.juce.com/t/directoryiterator-bug-with-invalid-empty-path-file/19523/2 "2016-10-19T09:21:10Z")

</div>

Thanks for the heads up. Fixed on develop now.

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [October 19, 2016, 9:53am UTC](https://forum.juce.com/t/directoryiterator-bug-with-invalid-empty-path-file/19523/3 "2016-10-19T09:53:11Z")

</div>

Thanks Fabian!  
I don’t see it in git though. did you push it?

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [October 19, 2016, 10:13am UTC](https://forum.juce.com/t/directoryiterator-bug-with-invalid-empty-path-file/19523/4 "2016-10-19T10:13:23Z")

</div>

OK. Clearly need more coffee… It’s up now.
