mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
trying some fixes for server crashing
This commit is contained in:
@@ -175,6 +175,16 @@ score = function(taskId, direction, options) {
|
||||
times: 1
|
||||
};
|
||||
}
|
||||
if (_.isEmpty(model.get('_user'))) {
|
||||
console.log({
|
||||
taskId: taskId,
|
||||
direction: direction,
|
||||
options: options,
|
||||
user: model.get('_user'),
|
||||
error: 'non-user attempted to score'
|
||||
});
|
||||
return 0;
|
||||
}
|
||||
taskPath = "_user.tasks." + taskId;
|
||||
_ref = [model.at(taskPath), model.get(taskPath)], task = _ref[0], taskObj = _ref[1];
|
||||
type = taskObj.type, value = taskObj.value;
|
||||
|
||||
Reference in New Issue
Block a user