From a4216e5382026ff9956af82322c7c5af24e0f245 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sat, 17 Aug 2019 00:18:50 +0200 Subject: [PATCH] Fix NPE in ObjectIdOwnerMap#get Change-Id: I3812961a27ac410d610ef50c73a28f21bb05ae79 Signed-off-by: Matthias Sohn --- .../src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.39.5