html: don't crash on empty notes list
This commit is contained in:
parent
dca0706fc5
commit
33930ccdcc
|
@ -400,16 +400,18 @@ namespace SparkleShare {
|
||||||
if (change_set.SupportsNotes) {
|
if (change_set.SupportsNotes) {
|
||||||
comments = "<table class=\"comments\">";
|
comments = "<table class=\"comments\">";
|
||||||
|
|
||||||
change_set.Notes.Sort ((x, y) => (x.Timestamp.CompareTo (y.Timestamp)));
|
if (change_set.Notes != null) {
|
||||||
|
change_set.Notes.Sort ((x, y) => (x.Timestamp.CompareTo (y.Timestamp)));
|
||||||
foreach (SparkleNote note in change_set.Notes) {
|
|
||||||
comments += "<tr>" +
|
foreach (SparkleNote note in change_set.Notes) {
|
||||||
" <td class=\"comment-author\">" + note.UserName + "</td>" +
|
comments += "<tr>" +
|
||||||
" <td class=\"comment-timestamp\">" + note.Timestamp.ToString ("d MMM") + "</td>" +
|
" <td class=\"comment-author\">" + note.UserName + "</td>" +
|
||||||
"</tr>" +
|
" <td class=\"comment-timestamp\">" + note.Timestamp.ToString ("d MMM") + "</td>" +
|
||||||
"<tr>" +
|
"</tr>" +
|
||||||
" <td class=\"comment-text\" colspan=\"2\">" + note.Body + "</td>" +
|
"<tr>" +
|
||||||
"</tr>";
|
" <td class=\"comment-text\" colspan=\"2\">" + note.Body + "</td>" +
|
||||||
|
"</tr>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
comments += "</table>";
|
comments += "</table>";
|
||||||
|
|
Loading…
Reference in a new issue