From e7fe68f73e441778f80683383ddb2ffe7a48f85c Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Thu, 29 Dec 2016 06:44:01 -0800 Subject: [PATCH] front-end check for author --- views/new-post.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/views/new-post.php b/views/new-post.php index 952f616..3418272 100644 --- a/views/new-post.php +++ b/views/new-post.php @@ -357,9 +357,11 @@ $(function(){ } else { $(".reply-context .post-name").addClass('hidden'); } - $(".reply-context .author .name").text(data.entry.author.name); - $(".reply-context .author .url").text(data.entry.author.url); - $(".reply-context img.author-img").attr('src', data.entry.author.photo); + if(data.entry.author) { + $(".reply-context .author .name").text(data.entry.author.name); + $(".reply-context .author .url").text(data.entry.author.url); + $(".reply-context img.author-img").attr('src', data.entry.author.photo); + } if(data.entry.photo) { $(".reply-context img.post-img").attr('src', data.entry.photo[0]).removeClass('hidden'); } else {