Skip to content

Commit 64eca71

Browse files
committed
check if the template's ok, otherwise throw an error
1 parent 5172c9f commit 64eca71

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/modules/padding.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ function Cache() {
4141
export default function Padding(template) {
4242
let result;
4343

44+
if(template.nodeType !== Node.ELEMENT_NODE) {
45+
throw new Error('ui-scroll directive requires an Element node for templating the view');
46+
}
47+
4448
switch (template.tagName.toLowerCase()) {
4549
case 'dl':
4650
throw new Error(`ui-scroll directive does not support <${template.tagName}> as a repeating tag: ${template.outerHTML}`);

0 commit comments

Comments
 (0)