rdblue commented on a change in pull request #543: Avoid NullPointerException in FindFiles when there is no snapshot URL: https://github.com/apache/incubator-iceberg/pull/543#discussion_r334695148
########## File path: core/src/test/java/org/apache/iceberg/TestFindFiles.java ########## @@ -153,6 +153,23 @@ public void testCaseSensitivity() { Assert.assertEquals(pathSet(FILE_A), pathSet(files)); } + @Test + public void testNoSnapshot() { + // a table has no snapshot when it just gets created and no data is loaded yet + + // verify NPE is NOT thrown + Iterable<DataFile> files = null; + try { + files = FindFiles.in(table).collect(); + } catch (NullPointerException npe) { + npe.printStackTrace(); Review comment: Instead of print, you can just call the method above without a try/catch block. It if fails with NPE, then the test will fail and show the exception. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org