Quellcode durchsuchen

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>
tags/v5.0.0.201805151920-m7
Markus Duft vor 6 Jahren
Ursprung
Commit
312e61a373
1 geänderte Dateien mit 4 neuen und 0 gelöschten Zeilen
  1. 4
    0
      org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java

+ 4
- 0
org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java Datei anzeigen

if (oid == null) { if (oid == null) {
oid = r.getObjectId(); oid = r.getObjectId();
} }
if (oid == null) {
// ignore (e.g. symbolic, ...)
continue;
}
RevObject o = walk.parseAny(oid); RevObject o = walk.parseAny(oid);
if (o.getType() == Constants.OBJ_COMMIT if (o.getType() == Constants.OBJ_COMMIT
|| o.getType() == Constants.OBJ_TAG) { || o.getType() == Constants.OBJ_TAG) {

Laden…
Abbrechen
Speichern