diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java index 9ef1722d7..8d59cb47b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java @@ -531,7 +531,7 @@ public abstract class RefUpdate { final String myName = getRef().getLeaf().getName(); if (myName.startsWith(Constants.R_HEADS)) { Ref head = getRefDatabase().getRef(Constants.HEAD); - while (head.isSymbolic()) { + while (head != null && head.isSymbolic()) { head = head.getTarget(); if (myName.equals(head.getName())) return result = Result.REJECTED_CURRENT_BRANCH;