From 7795a9ead259ecbbd4e381777b49185ec3f07fb4 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Fri, 30 Aug 2013 15:07:58 -0400 Subject: [PATCH] fixed a crash --- src/postTools.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/postTools.js b/src/postTools.js index 8f0aaaf6d5..d8e97cc66f 100644 --- a/src/postTools.js +++ b/src/postTools.js @@ -167,7 +167,7 @@ var RDB = require('./redis.js'), }); }); - // Restore topic if it is the only post + // Restore topic if it is the only post topics.getTopicField(postData.tid, 'postcount', function(err, count) { if (count === '1') { threadTools.restore(postData.tid, uid); @@ -186,6 +186,7 @@ var RDB = require('./redis.js'), } PostTools.toHTML = function(raw, callback) { + raw = raw || ''; plugins.fireHook('filter:post.parse', raw, function(parsed) { var cheerio = require('cheerio');