fix: skip non-existent collection

This commit is contained in:
chenos 2021-02-19 22:33:47 +08:00
parent 5000affc26
commit e980791796

View File

@ -82,7 +82,7 @@ export class AutomationModel extends Model {
const changedFields = (this.get('changed') as any) || []; const changedFields = (this.get('changed') as any) || [];
const M = this.database.getModel(collectionName); const M = this.database.getModel(collectionName);
const automationType = this.get('type'); const automationType = this.get('type');
if (automationType !== 'schedule' || !collectionName || !M) { if (automationType !== 'schedule' && (!collectionName || !M)) {
return; return;
} }
switch (automationType) { switch (automationType) {