From be2640b3944b80b67ff42573cfbb2d241cfe6c18 Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Thu, 14 Dec 2017 10:53:50 +0100 Subject: [PATCH] check for element before using it --- src/components/scroll/scroll.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/scroll/scroll.vue b/src/components/scroll/scroll.vue index 47cc3828..10c8e699 100644 --- a/src/components/scroll/scroll.vue +++ b/src/components/scroll/scroll.vue @@ -228,8 +228,8 @@ }, onScroll() { - if (this.isLoading) return; const el = this.$refs.scrollContainer; + if (this.isLoading || !el) return; const scrollDirection = Math.sign(this.lastScroll - el.scrollTop); // IE has no Math.sign, check that webpack polyfills this const displacement = el.scrollHeight - el.clientHeight - el.scrollTop;