summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib/utils/sticky.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-09-25 11:40:40 +0100
committerPhil Hughes <me@iamphill.com>2017-09-25 11:40:40 +0100
commitf389f9081f92b68d8d8369d29e8f05a65f47e9dc (patch)
treeebe268c563c3f7168ba82db888b9d82f3244b0be /app/assets/javascripts/lib/utils/sticky.js
parent65415e3208c29f52e3da6ccbdcdabcdf00bdb67b (diff)
downloadgitlab-ce-f389f9081f92b68d8d8369d29e8f05a65f47e9dc.tar.gz
refactor tests to actually test browser behaviour
Diffstat (limited to 'app/assets/javascripts/lib/utils/sticky.js')
-rw-r--r--app/assets/javascripts/lib/utils/sticky.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/assets/javascripts/lib/utils/sticky.js b/app/assets/javascripts/lib/utils/sticky.js
index 2803939c7cd..64db42701ce 100644
--- a/app/assets/javascripts/lib/utils/sticky.js
+++ b/app/assets/javascripts/lib/utils/sticky.js
@@ -22,7 +22,7 @@ export const isSticky = (el, scrollY, stickyTop, insertPlaceholder) => {
} else if (top > stickyTop && el.classList.contains('is-stuck')) {
el.classList.remove('is-stuck');
- if (insertPlaceholder && el.nextElementSibling.classList.contains('sticky-placeholder')) {
+ if (insertPlaceholder && el.nextElementSibling && el.nextElementSibling.classList.contains('sticky-placeholder')) {
el.nextElementSibling.remove();
}
}