From 78b59432cc0c770efb5840a16d1848fb28e7e7d6 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Fri, 17 May 2013 15:09:20 -0400 Subject: [PATCH] dont call marked if content is empty in get_teaser --- src/topics.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/topics.js b/src/topics.js index 8cd14057a7..94b77fc42a 100644 --- a/src/topics.js +++ b/src/topics.js @@ -271,8 +271,11 @@ marked.setOptions({ 'pid:' + pid + ':uid' ], function(err, content) { user.getUserField(content[1], 'username', function(username) { + var stripped = content[0]; + if(content[0]) + stripped = utils.strip_tags(marked(content[0])); callback({ - "text": utils.strip_tags(marked(content[0])), + "text": stripped, "username": username }); });