From 312e61a3737531c0bca2ace28a816edf6da59c64 Mon Sep 17 00:00:00 2001 From: Markus Duft Date: Tue, 20 Mar 2018 08:40:14 +0100 Subject: [PATCH] LFS: Fix potential NPE in LfsPrePushHook The NPE occurred in conjunction with a symbolic ref (origin/HEAD). Change-Id: I291636818a121ca00e0df25de5b6fc71a48d447f Signed-off-by: Markus Duft --- .../src/org/eclipse/jgit/lfs/LfsPrePushHook.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java index c522572ee..6115e3981 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java @@ -180,6 +180,10 @@ private void excludeRemoteRefs(ObjectWalk walk) throws IOException { if (oid == null) { oid = r.getObjectId(); } + if (oid == null) { + // ignore (e.g. symbolic, ...) + continue; + } RevObject o = walk.parseAny(oid); if (o.getType() == Constants.OBJ_COMMIT || o.getType() == Constants.OBJ_TAG) {