Skip to content

Commit

Permalink
💪 Throw an error when trying to register a non-object as an element
Browse files Browse the repository at this point in the history
  • Loading branch information
skerit committed Aug 12, 2024
1 parent f51e317 commit d73f723
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/core/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3195,6 +3195,14 @@ Renderer.setMethod(function hasBeenRegistered(element) {
*/
Renderer.setMethod(function registerElementInstance(element) {

if (!element) {
return;
}

if (typeof element != 'object') {
throw new Error('Unable to register element: not an object');
}

let he_elements,
variables = this.root_renderer.variables,
id = element.hawkejs_id || element.dataset.hid;
Expand Down

0 comments on commit d73f723

Please sign in to comment.