Skip to content

Commit

Permalink
Fix crash if there are no comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrainger committed Apr 11, 2012
1 parent 42e1db2 commit 9922768
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GitHubFeeds/Controllers/CommentsController.cs
Expand Up @@ -162,7 +162,7 @@ private static SyndicationFeed CreateFeed(ListParameters p, List<GitHubComment>
))
{
Id = "urn:x-feed:" + Uri.EscapeDataString(p.Server) + "/" + Uri.EscapeDataString(p.User) + "/" + Uri.EscapeDataString(p.Repo),
LastUpdatedTime = comments.Max(c => c.updated_at),
LastUpdatedTime = comments.Count == 0 ? DateTimeOffset.Now : comments.Max(c => c.updated_at),
Title = new TextSyndicationContent(string.Format("Comments for {0}/{1}", p.User, p.Repo)),
};

Expand Down

0 comments on commit 9922768

Please sign in to comment.