fixed crash if empty topic was loaded without ajaxify

This commit is contained in:
Baris Soner Usakli
2014-01-18 23:18:58 -05:00
parent 84cbcc5a97
commit bbac361670
7 changed files with 58 additions and 38 deletions

View File

@@ -259,6 +259,16 @@ var winston = require('winston'),
});
}
ThreadTools.getLatestUndeletedPost = function(tid, callback) {
ThreadTools.getLatestUndeletedPid(tid, function(err, pid) {
if(err) {
return callback(err);
}
posts.getPostData(pid, callback);
});
}
ThreadTools.getLatestUndeletedPid = function(tid, callback) {
db.getSortedSetRevRange('tid:' + tid + ':posts', 0, -1, function(err, pids) {
if(err) {