diff --git a/src/db-engines/post-by-app.js b/src/db-engines/post-by-app.js index cd4d1da..b287967 100644 --- a/src/db-engines/post-by-app.js +++ b/src/db-engines/post-by-app.js @@ -11,21 +11,24 @@ module.exports = async function (op, timestamp) { try { var post_app = JSON.parse(op[1].json_metadata).app; - - if (post_app.indexOf(config.target) > -1) { + + if (!post_app) { + + return; + + } else if (post_app && post_app.indexOf(config.target) > -1) { try { var sql = 'CALL new_post(?,?,?,?,?,?,?)'; var details = [ op[1].author, op[1].permlink, op[1].parent_permlink, op[1].title, op[1].body, ('/@' + op[1].author + '/' + op[1].permlink), timestamp ]; - + await pool.query(sql, details); - } - catch (err) { + } catch (err) { console.log(err); } - + } } catch (err) {