From 9dd8572b98db4f6e007c4398419adb86c4c67f18 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 13 Jul 2016 16:40:11 +0300 Subject: [PATCH] don't crash if anchorEl doesn't exist --- public/src/modules/navigator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/src/modules/navigator.js b/public/src/modules/navigator.js index 0fb1a7f368..93dc81ff06 100644 --- a/public/src/modules/navigator.js +++ b/public/src/modules/navigator.js @@ -143,8 +143,10 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, com threshold = 0; } else { var anchorEl = components.get('post/anchor', index - 1); - var anchorRect = anchorEl.get(0).getBoundingClientRect(); - threshold = anchorRect.top; + if (anchorEl.length) { + var anchorRect = anchorEl.get(0).getBoundingClientRect(); + threshold = anchorRect.top; + } } }