Merge pull request #3112 from marc1006/deepcode

Some fixes suggested by deepcode.ai
This commit is contained in:
Lauri Ojansivu 2020-05-24 18:56:36 +03:00 committed by GitHub
commit 01346152b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 16 additions and 15 deletions

View file

@ -100,13 +100,13 @@ Checklists.helpers({
},
checkAllItems() {
const checkItems = ChecklistItems.find({ checklistId: this._id });
checkItems.forEach(function(item) {
checkItems.forEach(item => {
item.check();
});
},
uncheckAllItems() {
const checkItems = ChecklistItems.find({ checklistId: this._id });
checkItems.forEach(function(item) {
checkItems.forEach(item => {
item.uncheck();
});
},
@ -307,7 +307,7 @@ if (Meteor.isServer) {
items = [items];
}
}
items.forEach(function(item, idx) {
items.forEach((item, idx) => {
ChecklistItems.insert({
cardId: paramCardId,
checklistId: id,

View file

@ -259,7 +259,7 @@ if (Meteor.isServer) {
throw new Meteor.Error('invalid-user');
}
const user = Meteor.user();
if (!user.emails && !user.emails[0] && user.emails[0].address) {
if (!user.emails || !user.emails[0] || user.emails[0].address) {
throw new Meteor.Error('email-invalid');
}
this.unblock();