From d5a34551d595a348eb6234b9cf295a584a5cb1d6 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sat, 11 Apr 2015 23:56:41 +0200 Subject: [PATCH] Fix potential null pointer access in IndexDiffFilter Change-Id: I39c2ea6b3090d7028cc1e246af6e3cc4e7bc70c2 Signed-off-by: Matthias Sohn --- .../src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java index 3ef3d97916..42725bc767 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java @@ -224,7 +224,8 @@ public class IndexDiffFilter extends TreeFilter { // Only one chance left to detect a diff: between index and working // tree. Make use of the WorkingTreeIterator#isModified() method to // avoid computing SHA1 on filesystem content if not really needed. - return wi.isModified(di.getDirCacheEntry(), true, tw.getObjectReader()); + return wi.isModified(di == null ? null : di.getDirCacheEntry(), true, + tw.getObjectReader()); } /** -- 2.39.5