]> git.proxmox.com Git - libgit2.git/commitdiff
git_reflog_entry_message can be null
authorLinquize <linquize@yahoo.com.hk>
Mon, 20 Jan 2014 15:32:18 +0000 (23:32 +0800)
committerLinquize <linquize@yahoo.com.hk>
Mon, 20 Jan 2014 15:32:18 +0000 (23:32 +0800)
src/revparse.c

index c120b466f75629d660796cd39b87519c8b2b15c8..5cce3be63fae7669f8e89df12bd040ef23399646 100644 (file)
@@ -168,6 +168,8 @@ static int retrieve_previously_checked_out_branch_or_revision(git_object **out,
        for (i = 0; i < numentries; i++) {
                entry = git_reflog_entry_byindex(reflog, i);
                msg = git_reflog_entry_message(entry);
+               if (!msg)
+                       continue;
 
                if (regexec(&preg, msg, 2, regexmatches, 0))
                        continue;