From: David Pursehouse Date: Thu, 14 Jan 2016 06:06:10 +0000 (+0900) Subject: RefUpdateTest: Add null check to prevent potential NPE X-Git-Tag: v4.2.0.201601211800-r~30 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=56634de0cc3b0fd0d66bd867210e7e2d74451cea;p=jgit.git RefUpdateTest: Add null check to prevent potential NPE Change-Id: I64b1850c3bb80b09409044461ca3fdde1c46d4bb Signed-off-by: David Pursehouse --- diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java index 8744ed1bd6..4ae92ccbe2 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefUpdateTest.java +++ b/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)); 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 {