Wordlist is undefined

This commit is contained in:
Belen Curcio
2017-01-20 18:04:30 -03:00
parent 2615db8575
commit 715faf321f
+5 -2
View File
@@ -1,5 +1,6 @@
const errors = require('../errors');
/* eslint eqeqeq: ["error", "smart"]*/
const errors = require('../errors');
const Action = require('../models/action');
const Asset = require('../models/asset');
const Comment = require('../models/comment');
@@ -118,7 +119,9 @@ const createPublicComment = (context, commentInput) => {
// If the comment was flagged as being suspect, we need to add a
// flag to it to indicate that it needs to be looked at.
// Otherwise just return the new comment.
if (wordlist !== null && wordlist.suspect) {
// TODO: Check why the wordlist is undefined
if (wordlist != null) {
// TODO: this is kind of fragile, we should refactor this to resolve
// all these const's that we're using like 'comments', 'flag' to be