From 0bcc0598f4ae6a7d224b3aa1f794204d0265a270 Mon Sep 17 00:00:00 2001
From: Alexandru Munteanu <alexandru.munt@gmail.com>
Date: Mon, 21 May 2018 11:35:33 +0300
Subject: [PATCH] fox

---
 .../src/components/Dashboard/DashboardCard.js              | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/packages/components-faraday/src/components/Dashboard/DashboardCard.js b/packages/components-faraday/src/components/Dashboard/DashboardCard.js
index a47c5ee88..cd03a3fc0 100644
--- a/packages/components-faraday/src/components/Dashboard/DashboardCard.js
+++ b/packages/components-faraday/src/components/Dashboard/DashboardCard.js
@@ -169,10 +169,9 @@ const DashboardCard = ({
 const isHEToManuscript = (state, collectionId) => {
   const currentUserId = get(state, 'currentUser.user.id')
   const collections = get(state, 'collections') || []
-  const collection = collections.find(c => c.id === collectionId) || {
-    invitations: [],
-  }
-  const userInvitation = collection.invitations.find(
+  const collection = collections.find(c => c.id === collectionId) || {}
+  const collectionInvitations = get(collection, 'invitations') || []
+  const userInvitation = collectionInvitations.find(
     i => i.role === 'handlingEditor' && i.userId === currentUserId,
   )
 
-- 
GitLab