mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
fix: Provide default history [] for habit in score route
This commit is contained in:
@@ -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()),
|
||||
|
||||
Reference in New Issue
Block a user