| commit | 312e61a3737531c0bca2ace28a816edf6da59c64 | [log] [tgz] |
|---|---|---|
| author | Markus Duft <markus.duft@ssi-schaefer.com> | Tue Mar 20 08:40:14 2018 +0100 |
| committer | David Pursehouse <david.pursehouse@gmail.com> | Wed Apr 04 17:30:58 2018 -0400 |
| tree | ccb1bc4f05986f06edaae8968d67247d256ddb8f | |
| parent | a263bb11733de8d8113c5ad72030785bc95ebf33 [diff] |
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 <markus.duft@ssi-schaefer.com>
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 c522572..6115e39 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) {