Fixed issue when repeat object is malformed (#8765)

* Fixed issue when repeat object is malformed

* Removed only

* Changed numeric check to lodash isFinite

* Removed newer lodash function
This commit is contained in:
Keith Holliday
2017-05-28 19:07:29 -06:00
committed by Sabe Jones
parent feae40cf0a
commit 6f034bb5dd
2 changed files with 20 additions and 0 deletions

View File

@@ -113,6 +113,7 @@ export function shouldDo (day, dailyTask, options = {}) {
if (dailyTask.repeat) {
for (let [repeatDay, active] of Object.entries(dailyTask.repeat)) {
if (!isFinite(DAY_MAPPING_STRING_TO_NUMBER[repeatDay])) continue; // eslint-disable-line no-continue
if (active) daysOfTheWeek.push(parseInt(DAY_MAPPING_STRING_TO_NUMBER[repeatDay], 10));
}
}