Skip to content

Commit

Permalink
[blaze] Add 'unkown template' as a fallback to templateName
Browse files Browse the repository at this point in the history
  • Loading branch information
harryadel committed Jun 19, 2022
1 parent dc2a520 commit 334130c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/blaze/domrange.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ DOMRange.prototype.destroy = function (_skipNodes) {
};

DOMRange.prototype.containsElement = function (elem, selector, event) {
const templateName = this.view.name?.split('.')[1];
const templateName = this.view?.name
? this.view.name.split('.')[1]
: 'unknown template';
if (! this.attached)
throw new Error(`${event} event triggerd with ${selector} on ${templateName} but associated view is not be found.
Make sure the event doesn't destroy the view.`);
Expand Down

0 comments on commit 334130c

Please sign in to comment.