diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java index 2ca9e83f1..cbf745213 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java @@ -643,9 +643,10 @@ public class PackFile implements Iterable { } private void doOpen() throws IOException { + if (invalid) { + throw new PackInvalidException(packFile); + } try { - if (invalid) - throw new PackInvalidException(packFile); synchronized (readLock) { fd = new RandomAccessFile(packFile, "r"); //$NON-NLS-1$ length = fd.length();