From b8770ba98bf5e077a81b8f543a045580088a548e Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 31 Jul 2017 11:23:19 +0100 Subject: [PATCH] fixed karma failure --- app/assets/javascripts/lib/utils/sticky.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/javascripts/lib/utils/sticky.js b/app/assets/javascripts/lib/utils/sticky.js index b5fde040a17..43a808b6ab3 100644 --- a/app/assets/javascripts/lib/utils/sticky.js +++ b/app/assets/javascripts/lib/utils/sticky.js @@ -9,6 +9,8 @@ export const isSticky = (el, scrollY, stickyTop) => { }; export default (el) => { + if (!el) return; + const computedStyle = window.getComputedStyle(el); if (!/sticky/.test(computedStyle.position)) return;