Преглед на файлове

DHT: Fix NPE during prefetch

The Prefetcher may have loaded a chunk that is a fragment, if the
DhtReader is scanning the Prefetcher's chunks for a particular
object fragment chunks will be missing the index and NPE during
the findOffset() call into the index itself.

Change-Id: Ie2823724c289f745655076c5209acec32361a1ea
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
tags/v1.1.0.201109011030-rc2
Shawn O. Pearce преди 13 години
родител
ревизия
d00f527d65
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1
    1
      org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/PackChunk.java

+ 1
- 1
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/PackChunk.java Целия файл

@@ -291,7 +291,7 @@ public final class PackChunk {
}

int findOffset(RepositoryKey repo, AnyObjectId objId) {
if (key.getRepositoryId() == repo.asInt())
if (key.getRepositoryId() == repo.asInt() && index != null)
return index.findOffset(objId);
return -1;
}

Loading…
Отказ
Запис