From 3f5b8f5d9203aa7ffb7fbe9cdbaf9dba3da6cae6 Mon Sep 17 00:00:00 2001 From: Hybris95 <hybris_95@hotmail.com> Date: Thu, 01 May 2014 16:14:15 -0400 Subject: [PATCH] Fixes sort, page building and search functions on "my tickets" page. --- src/main/java/com/gitblit/models/AnnotatedLine.java | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gitblit/models/AnnotatedLine.java b/src/main/java/com/gitblit/models/AnnotatedLine.java index 69b55bc..a8b595e 100644 --- a/src/main/java/com/gitblit/models/AnnotatedLine.java +++ b/src/main/java/com/gitblit/models/AnnotatedLine.java @@ -18,14 +18,15 @@ import java.io.Serializable; import java.util.Date; +import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.revwalk.RevCommit; /** * AnnotatedLine is a serializable model class that represents a the most recent * author, date, and commit id of a line in a source file. - * + * * @author James Moger - * + * */ public class AnnotatedLine implements Serializable { @@ -38,9 +39,15 @@ public final String data; public AnnotatedLine(RevCommit commit, int lineNumber, String data) { - this.commitId = commit.getName(); - this.author = commit.getAuthorIdent().getName(); - this.when = commit.getAuthorIdent().getWhen(); + if (commit == null) { + this.commitId = ObjectId.zeroId().getName(); + this.author = "?"; + this.when = new Date(0); + } else { + this.commitId = commit.getName(); + this.author = commit.getAuthorIdent().getName(); + this.when = commit.getAuthorIdent().getWhen(); + } this.lineNumber = lineNumber; this.data = data; } -- Gitblit v1.9.1