From: Matthias Sohn Date: Fri, 16 Aug 2019 22:18:50 +0000 (+0200) Subject: Fix NPE in ObjectIdOwnerMap#get X-Git-Tag: v5.1.9.201908210455-r~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a4216e5382026ff9956af82322c7c5af24e0f245;p=jgit.git Fix NPE in ObjectIdOwnerMap#get Change-Id: I3812961a27ac410d610ef50c73a28f21bb05ae79 Signed-off-by: Matthias Sohn --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java index 9df593375d..74c712c46c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java @@ -135,6 +135,9 @@ public class ObjectIdOwnerMap */ @SuppressWarnings("unchecked") public V get(AnyObjectId toFind) { + if (toFind == null) { + return null; + } int h = toFind.w1; V obj = directory[h & mask][h >>> SEGMENT_SHIFT]; for (; obj != null; obj = (V) obj.next)