Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2015-09-28 03:24:33 -0400
committerMatthias Sohn2015-09-28 03:24:33 -0400
commite151ea80fe55155fcdc0048252f21cbf508ac126 (patch)
tree6adca0bc863d86fada06cfc8a704f1fff35d9da6
parentc12a9d7f41682491b16e79fc4f436c72518eed19 (diff)
downloadegit-e151ea80fe55155fcdc0048252f21cbf508ac126.tar.gz
egit-e151ea80fe55155fcdc0048252f21cbf508ac126.tar.xz
egit-e151ea80fe55155fcdc0048252f21cbf508ac126.zip
Fix potential NPE in ReleaseStartOperation.findHead()
Change-Id: Ie189acbce9b0e3d99dab860b427e02ff3c1ba33c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java
index b2a13a463..22d3d6d88 100644
--- a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java
+++ b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java
@@ -23,6 +23,7 @@ import org.eclipse.egit.gitflow.GitFlowConfig;
import org.eclipse.egit.gitflow.GitFlowRepository;
import org.eclipse.egit.gitflow.WrongGitFlowStateException;
import org.eclipse.egit.gitflow.internal.CoreText;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jgit.errors.AmbiguousObjectException;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.RevisionSyntaxException;
@@ -121,8 +122,10 @@ public final class ReleaseStartOperation extends AbstractReleaseOperation {
}
}
+ @Nullable
private static String findHead(GitFlowRepository repository) {
GitFlowConfig config = repository.getConfig();
- return repository.findHead(config.getDevelop()).getName();
+ RevCommit head = repository.findHead(config.getDevelop());
+ return head == null ? null : head.getName();
}
}

Back to the top