From 06f00a7dc51b9a268b875599d7516b7d61e4ccf6 Mon Sep 17 00:00:00 2001 From: plehegar Date: Fri, 14 Sep 2018 16:02:34 -0400 Subject: [PATCH] string.match(regexp) returns null if no match --- lib/validator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/validator.js b/lib/validator.js index 8b78c2feb..be9d1cb82 100644 --- a/lib/validator.js +++ b/lib/validator.js @@ -329,10 +329,12 @@ Specberus.prototype.getFeedbackDueDate = function() { ; dates= []; - for (var i = 0; i < candidates.length; i++) { + if (candidates !== null) { + for (var i = 0; i < candidates.length; i++) { var d = this.stringToDate(candidates[i]); if (d >= lowBound && d < highBound) dates.push(d); + } } } return dates;