]> source.dussan.org Git - jgit.git/commitdiff
Fix NPE in ObjectIdOwnerMap#get 63/147863/8
authorMatthias Sohn <matthias.sohn@sap.com>
Fri, 16 Aug 2019 22:18:50 +0000 (00:18 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Sun, 18 Aug 2019 09:59:54 +0000 (11:59 +0200)
Change-Id: I3812961a27ac410d610ef50c73a28f21bb05ae79
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java

index 9df593375d2009c8e640c2eaca9219fc091a74fc..74c712c46cd2dd62ee72afdbfdb05724bbb9f03d 100644 (file)
@@ -135,6 +135,9 @@ public class ObjectIdOwnerMap<V extends ObjectIdOwnerMap.Entry>
         */
        @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)