summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2014-12-12 08:31:16 -0500
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2014-12-12 08:31:16 -0500
commitc893534059d72fa4c0dbf7b85012b019666ff3c5 (patch)
tree4afe91b2a7900147a1b280dd53764b96be83a0e0 /org.eclipse.jgit
parent1a054f12298f5c34efc9da7f4b43c73904f68fc0 (diff)
parenta24a99a13dc7bc256c9edc9703bc4a9d28b33ce7 (diff)
downloadjgit-c893534059d72fa4c0dbf7b85012b019666ff3c5.tar.gz
jgit-c893534059d72fa4c0dbf7b85012b019666ff3c5.zip
Merge "Prevent NPE if ref can't be resolved when executing ReflogCommand" into stable-3.6
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java
index 8cd78aebe1..4536af1be0 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java
@@ -48,6 +48,7 @@ import java.util.Collection;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.InvalidRefNameException;
+import org.eclipse.jgit.api.errors.RefNotFoundException;
import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ReflogEntry;
@@ -97,6 +98,9 @@ public class ReflogCommand extends GitCommand<Collection<ReflogEntry>> {
try {
ReflogReader reader = repo.getReflogReader(ref);
+ if (reader == null)
+ throw new RefNotFoundException(MessageFormat.format(
+ JGitText.get().refNotResolved, ref));
return reader.getReverseEntries();
} catch (IOException e) {
throw new InvalidRefNameException(MessageFormat.format(