fix: Provide default history [] for habit in score route

This commit is contained in:
Blade Barringer
2016-05-16 22:52:32 -05:00
parent bf2e6489b7
commit 4f1d738272

View File

@@ -194,6 +194,7 @@ module.exports = function scoreTask (options = {}, req = {}) {
}
_gainMP(user, _.max([0.25, 0.0025 * user._statsComputed.maxMP]) * (direction === 'down' ? -1 : 1));
task.history = task.history || [];
// Add history entry, even more than 1 per day
task.history.push({
date: Number(new Date()),