From d4f245e414ed7e9244e2d92d9916f781ad206497 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 9 Nov 2014 21:28:27 +0100 Subject: [PATCH] Fixed stack trace in home when no post is featured --- public_html/js/Presenters/HomePresenter.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public_html/js/Presenters/HomePresenter.js b/public_html/js/Presenters/HomePresenter.js index f037b185..2cce1835 100644 --- a/public_html/js/Presenters/HomePresenter.js +++ b/public_html/js/Presenters/HomePresenter.js @@ -38,9 +38,11 @@ App.Presenters.HomePresenter = function( render(); loaded(); - presenterManager.initPresenters([ - [postContentPresenter, {post: post, $target: $el.find('#post-content-target')}]], - function() {}); + if ($el.find('#post-content-target').length > 0) { + presenterManager.initPresenters([ + [postContentPresenter, {post: post, $target: $el.find('#post-content-target')}]], + function() {}); + } }).fail(function(response) { messagePresenter.showError($el, response.json && response.json.error || response);