diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackFile.java index ed6628596..80cced84e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackFile.java @@ -277,6 +277,8 @@ public final class DfsPackFile { } PackBitmapIndex getBitmapIndex(DfsReader ctx) throws IOException { + if (invalid) + return null; DfsBlockCache.Ref idxref = bitmapIndex; if (idxref != null) { PackBitmapIndex idx = idxref.get(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java index 31de38172..cd5de595c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java @@ -1057,6 +1057,8 @@ public class PackFile implements Iterable { } synchronized PackBitmapIndex getBitmapIndex() throws IOException { + if (invalid) + return null; if (bitmapIdx == null && hasExt(BITMAP_INDEX)) { final PackBitmapIndex idx = PackBitmapIndex.open( extFile(BITMAP_INDEX), idx(), getReverseIdx());