From 0e6b0c01fd7565ad4c0e2e3485218752fcf0cb88 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Wed, 19 Apr 2017 21:06:57 +0700 Subject: [PATCH] Fix issue with ignoredUsers --- graph/resolvers/root_query.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/graph/resolvers/root_query.js b/graph/resolvers/root_query.js index b26ecabca..8de1988ff 100644 --- a/graph/resolvers/root_query.js +++ b/graph/resolvers/root_query.js @@ -84,7 +84,9 @@ const RootQuery = { }, myIgnoredUsers: async (_, args, {user, loaders: {Users}}) => { - + if (user == null) { + return []; + } // get currentUser again since context.user was out of date when running test/graph/mutations/ignoreUser const currentUser = (await Users.getByQuery({ids: [user.id], limit: 1}))[0]; if ( ! (currentUser && Array.isArray(currentUser.ignoresUsers) && currentUser.ignoresUsers.length)) {