From 55f137c19cf45f4fd17249b5a23650c84b0d4f23 Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Tue, 27 Oct 2015 15:48:51 -0400
Subject: Creating hierarchy

---
 web/react/components/sidebar_right.jsx | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

(limited to 'web/react/components/sidebar_right.jsx')

diff --git a/web/react/components/sidebar_right.jsx b/web/react/components/sidebar_right.jsx
index 51225cbbe..2ec2b5bbf 100644
--- a/web/react/components/sidebar_right.jsx
+++ b/web/react/components/sidebar_right.jsx
@@ -53,9 +53,13 @@ export default class SidebarRight extends React.Component {
     }
     render() {
         var postHolder = $('.post-list-holder-by-time').not('.inactive');
-        const position = postHolder.scrollTop() + postHolder.height() + 14;
-        const bottom = postHolder[0].scrollHeight;
-        this.plScrolledToBottom = position >= bottom;
+        if (postHolder[0]) {
+            const position = postHolder.scrollTop() + postHolder.height() + 14;
+            const bottom = postHolder[0].scrollHeight;
+            this.plScrolledToBottom = position >= bottom;
+        } else {
+            this.plScrolledToBottom = true;
+        }
 
         if (!(this.state.search_visible || this.state.post_right_visible)) {
             $('.inner__wrap').removeClass('move--left').removeClass('move--right');
-- 
cgit v1.2.3-1-g7c22

