]> source.dussan.org Git - jgit.git/commitdiff
RefUpdateTest: Add null check to prevent potential NPE 13/64313/1
authorDavid Pursehouse <david.pursehouse@sonymobile.com>
Thu, 14 Jan 2016 06:06:10 +0000 (15:06 +0900)
committerDavid Pursehouse <david.pursehouse@sonymobile.com>
Thu, 14 Jan 2016 06:06:10 +0000 (15:06 +0900)
Change-Id: I64b1850c3bb80b09409044461ca3fdde1c46d4bb
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java

index 8744ed1bd675122926e48c666f0050095d8eb8f6..4ae92ccbe2c75a902c74b0960f5a8bcb5aaf40a6 100644 (file)
@@ -751,7 +751,7 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase {
                        assertNull(db.resolve(toName));
                        assertEquals(oldFromLog.toString(), db.getReflogReader(fromName)
                                        .getReverseEntries().toString());
-                       if (oldHeadId != null)
+                       if (oldHeadId != null && oldHeadLog != null)
                                assertEquals(oldHeadLog.toString(), db.getReflogReader(
                                                Constants.HEAD).getReverseEntries().toString());
                } finally {