]> source.dussan.org Git - jgit.git/commit
PackInserterTest: Prevent potential NPE dereferencing Path.getFileName() 49/113049/1
authorDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 8 Dec 2017 08:21:35 +0000 (17:21 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 8 Dec 2017 08:21:52 +0000 (17:21 +0900)
commitc861c0e2ee3eb919e8d43f7244e891084ac58513
tree6f52c7802f7c4fc699435346178efbde64a98a1c
parent0e5b9f8a39a955a58f39466264afed372b27aaa2
PackInserterTest: Prevent potential NPE dereferencing Path.getFileName()

Path.getFileName() may return null if the path has zero elements.

Enclose the dereference in a null-check.

Change-Id: I7ea3d3f07edc13a80b593d28e8fd512a4e1ed56b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackInserterTest.java