diff options
author | Markus Duft <markus.duft@ssi-schaefer.com> | 2018-03-20 08:40:14 +0100 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-04-04 17:30:58 -0400 |
commit | 312e61a3737531c0bca2ace28a816edf6da59c64 (patch) | |
tree | ccb1bc4f05986f06edaae8968d67247d256ddb8f /org.eclipse.jgit.lfs/src/org/eclipse | |
parent | a263bb11733de8d8113c5ad72030785bc95ebf33 (diff) | |
download | jgit-312e61a3737531c0bca2ace28a816edf6da59c64.tar.gz jgit-312e61a3737531c0bca2ace28a816edf6da59c64.zip |
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>
Diffstat (limited to 'org.eclipse.jgit.lfs/src/org/eclipse')
-rw-r--r-- | org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java | 4 |
1 files changed, 4 insertions, 0 deletions
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 c522572ee3..6115e39813 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 @@ public class LfsPrePushHook extends PrePushHook { 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) { |