Commit ef3e7dcd authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Fix comments server crash when no comments.

Loading the recent comments page caused a crash when there were no
comments.
parent f562e632
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -203,9 +203,11 @@ app.get('/auth/:sdk/:version/comments_recent', util.getCommentReads, function(re
        // Count all comments, store count to last comment
        Comment.count(filter).run(function(err, count) {
            var last = comments[comments.length-1];
            if (last) {
                last.total_rows = count;
                last.offset = offset;
                last.limit = limit;
            }
            res.json(comments);
        });
    });