]> source.dussan.org Git - jgit.git/commitdiff
Fix potential null pointer access in IndexDiffFilter 01/45701/5
authorMatthias Sohn <matthias.sohn@sap.com>
Sat, 11 Apr 2015 21:56:41 +0000 (23:56 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 26 May 2015 08:52:22 +0000 (10:52 +0200)
Change-Id: I39c2ea6b3090d7028cc1e246af6e3cc4e7bc70c2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java

index 3ef3d979164f9e25c8f7c356210c9674adc6cd97..42725bc76790d4e7f9880a835a1f16db055149fe 100644 (file)
@@ -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());
        }
 
        /**