sbtourist / Journal.IO

Journal.IO is a zero-dependency, fast and easy-to-use journal storage implementation.
Apache License 2.0
260 stars 39 forks source link

NPE thrown when File#listFiles throws null #34

Closed jeluard closed 11 years ago

jeluard commented 11 years ago

File#listFiles throwing null is not consistently handled and might throw a NPE. Fixing that in current codebase makes next #write call throw a FileNotFoundException (which is a good as before it failed silently).

Now I am wondering if an Exception should not be thrown before to ensure consistency (during open?). Does it make sense to continue when File#listFiles returns null?

sbtourist commented 11 years ago

Right, an exception should definitely be thrown during open(), as listFiles() can only return null if the provided path does not exist or cannot be read.

Feeling like submitting a pull request for that? :)

jeluard commented 11 years ago

Sure I'll do that! Still fighting with git.

jeluard commented 11 years ago

Ok last one should be fine. Not sure how to clean all previous messages though (they belong to now deleted branches).