]> source.dussan.org Git - jgit.git/commitdiff
Fix possible NPE in Repository.resolve 62/22462/1
authorMarc Strapetz <marc.strapetz@syntevo.com>
Thu, 16 Jan 2014 15:55:50 +0000 (16:55 +0100)
committerMarc Strapetz <marc.strapetz@syntevo.com>
Mon, 24 Feb 2014 17:39:38 +0000 (18:39 +0100)
Change-Id: I9b19cd90b338a4c3cae5661c658526b7e98c95d1
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>‌
org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java

index 291803ee59b4a5cb8dc723d964e08fc7bb4316f6..c350dddb2590d8398f01acfe745587e6deab0fbf 100644 (file)
@@ -384,7 +384,8 @@ public abstract class Repository {
                try {
                        Object resolved = resolve(rw, revstr);
                        if (resolved instanceof String) {
-                               return getRef((String) resolved).getLeaf().getObjectId();
+                               final Ref ref = getRef((String)resolved);
+                               return ref != null ? ref.getLeaf().getObjectId() : null;
                        } else {
                                return (ObjectId) resolved;
                        }