Browse Source

RefUpdateTest: Add null check to prevent potential NPE

Change-Id: I64b1850c3bb80b09409044461ca3fdde1c46d4bb
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
stable-4.2
David Pursehouse 9 years ago
parent
commit
56634de0cc
  1. 2
      org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java

2
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java

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

Loading…
Cancel
Save