Skip to content

Commit 63d2344

Browse files
committed
fix(ModelManager): Add guard in hooks execution
1 parent c54c3a8 commit 63d2344

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/core/ModelManager.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,11 @@ export default class ModelManager {
281281
const names = Object.keys(this.data);
282282
for (let i = 0; i < names.length; i++) {
283283
const name = names[i];
284-
const hooks = this.model.views[name].hooks || [];
285-
for (let viewIdx = 0; viewIdx < this.data[name].length; viewIdx++) {
286-
this.runHooks(name, viewIdx);
284+
if (this.model.views[name]) {
285+
const hooks = this.model.views[name].hooks || [];
286+
for (let viewIdx = 0; viewIdx < this.data[name].length; viewIdx++) {
287+
this.runHooks(name, viewIdx);
288+
}
287289
}
288290
}
289291
}

0 commit comments

Comments
 (0)