]> source.dussan.org Git - jgit.git/commitdiff
[findBugs] Fix potential NPE in GcPackRefsTest 83/87783/1
authorMatthias Sohn <matthias.sohn@sap.com>
Thu, 29 Dec 2016 00:04:25 +0000 (01:04 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 29 Dec 2016 00:04:25 +0000 (01:04 +0100)
Change-Id: I273c06b9b2ce36c8232803cb7f02d7f846ed49e5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java

index ea8dfa2939d6886d86d19250bc0087c0be8c6583..22bec3762055958cc4abd62ce82e7e7aa3a022d5 100644 (file)
@@ -46,6 +46,7 @@ package org.eclipse.jgit.internal.storage.file;
 import static java.lang.Integer.valueOf;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 
@@ -89,7 +90,7 @@ public class GcPackRefsTest extends GcTestCase {
                tr.branch(ref).commit().create();
                String name = repo.findRef(ref).getName();
                Path dir = repo.getDirectory().toPath().resolve(name).getParent();
-
+               assertNotNull(dir);
                gc.packRefs();
                assertFalse(Files.exists(dir));
        }