From 55067d74fb2a472aa5de9c0c917d1219821b81fe Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 13 Dec 2017 04:32:57 +0100 Subject: thread zero check --- public/assets/js/lib/views/index/threadbox.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'public/assets/js/lib/views/index/threadbox.js') diff --git a/public/assets/js/lib/views/index/threadbox.js b/public/assets/js/lib/views/index/threadbox.js index 83ac269..65ad945 100644 --- a/public/assets/js/lib/views/index/threadbox.js +++ b/public/assets/js/lib/views/index/threadbox.js @@ -91,9 +91,11 @@ var ThreadBox = View.extend({ }, appendThreads: function(threads){ - threads[0].first = true - threads[threads.length-1].last = true - threads.forEach(this.appendThread.bind(this)) + if (threads.length) { + threads[0].first = true + threads[threads.length-1].last = true + threads.forEach(this.appendThread.bind(this)) + } }, appendThread: function(thread){ -- cgit v1.2.3-70-g09d2