From 9162eeb69bafe2d33b4e9e5e1d2715afbaa9301f Mon Sep 17 00:00:00 2001 From: Bryan Smith Date: Tue, 3 Mar 2015 18:13:23 -0800 Subject: [PATCH] fix(view-slot): correct null check against nextElementSibling --- src/view-slot.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/view-slot.js b/src/view-slot.js index 0fe3ffd4..3f5633eb 100644 --- a/src/view-slot.js +++ b/src/view-slot.js @@ -73,7 +73,7 @@ export class ViewSlot { // Animate page itself var element = view.firstChild.nextElementSibling; if(view.firstChild.nodeType === 8 && - element !== undefined && + element !== null && element.nodeType === 1 && element.classList.contains('au-animate')) { this.animator.enter(element); @@ -120,7 +120,7 @@ export class ViewSlot { var element = view.firstChild.nextElementSibling; if(view.firstChild.nodeType === 8 && - element !== undefined && + element !== null && element.nodeType === 1 && element.classList.contains('au-animate')) { return this.animator.leave(element).then( () => { @@ -142,7 +142,7 @@ export class ViewSlot { var element = child.firstChild.nextElementSibling; if(child.firstChild !== undefined && child.firstChild.nodeType === 8 && - element !== undefined && + element !== null && element.nodeType === 1 && element.classList.contains('au-animate')) { rmPromises.push(this.animator.leave(element).then( () => { @@ -198,7 +198,7 @@ export class ViewSlot { var element = children[i].firstChild.nextElementSibling; if(children[i].firstChild.nodeType === 8 && - element !== undefined && + element !== null && element.nodeType === 1 && element.classList.contains('au-animate')) { this.animator.enter(element);