Skip to content

Commit 00a96ab

Browse files
committed
Don't crash on unparseable edits. Fixes #310.
1 parent cc9b31a commit 00a96ab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/forum.nim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,11 @@ proc selectHistory(postId: int): seq[PostInfo] =
358358
for row in getAllRows(db, historyQuery, $postId):
359359
result.add(PostInfo(
360360
creation: row[0].parseInt(),
361-
content: row[1].rstToHtml()
361+
content:
362+
try:
363+
row[1].rstToHtml()
364+
except EParseError:
365+
span(class="text-error", "Couldn't render historic post in #$1." % $postId)
362366
))
363367

364368
proc selectLikes(postId: int): seq[User] =

0 commit comments

Comments
 (0)