From 5da5cde79ad1300aad1b6f98a2c29a7d0547c80c Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Thu, 13 Aug 2015 00:32:51 +0500 Subject: [PATCH] add check to newRtMsg() to avoid undefined sig_userpost --- js/twister_actions.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/twister_actions.js b/js/twister_actions.js index 82db067..3502729 100644 --- a/js/twister_actions.js +++ b/js/twister_actions.js @@ -285,6 +285,14 @@ function newRtMsg(postData, msg) { sig_userpost = postData.attr('data-content_to_sigrt'); } + if (typeof sig_userpost === 'undefined') { + alert(polyglot.t('error', + {error: 'can\'t sig_userpost is not deifned'} + )); + + return; + } + var rtObj = {sig_userpost: sig_userpost, userpost: userpost}; if (typeof lastPostId !== 'undefined') {