From ce4835aad6418a898933b082e505171ca6ef1132 Mon Sep 17 00:00:00 2001 From: Jonas Braathen Date: Fri, 18 Jan 2019 00:26:38 +0100 Subject: [PATCH] Fix building author pages for authors with no posts --- src/templates/author.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templates/author.js b/src/templates/author.js index 75d66d2..d98afd5 100644 --- a/src/templates/author.js +++ b/src/templates/author.js @@ -15,7 +15,7 @@ const Author = props => { // The `authored_wordpress__POST` returns a simple array instead of an array // of edges / nodes. We therefore need to convert the array here. - const posts = authored_wordpress__POST.map(post => ({ + const posts = (totalCount === 0) ? [] : authored_wordpress__POST.map(post => ({ node: post, }))