summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2015-04-11 23:56:41 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2015-05-26 10:52:22 +0200
commitd5a34551d595a348eb6234b9cf295a584a5cb1d6 (patch)
treeccae2054e5a61c23afe4a19144409a6722070f7f
parentbb48901ddff79f0d81000b7e383fba9a8be6d23c (diff)
downloadjgit-d5a34551d595a348eb6234b9cf295a584a5cb1d6.tar.gz
jgit-d5a34551d595a348eb6234b9cf295a584a5cb1d6.zip
Fix potential null pointer access in IndexDiffFilter
Change-Id: I39c2ea6b3090d7028cc1e246af6e3cc4e7bc70c2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java3
1 files changed, 2 insertions, 1 deletions
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());
}
/**