From f832cb9acb63ec184549cacda6a7886c80a15fdd Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 24 Oct 2020 00:11:56 -0700 Subject: [PATCH] oops, fix crash when no neomail contact exists --- src/server/types/User.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/types/User.js b/src/server/types/User.js index 43a253f..147805a 100644 --- a/src/server/types/User.js +++ b/src/server/types/User.js @@ -28,6 +28,10 @@ const resolvers = { { userLoader, neopetsConnectionLoader } ) => { const user = await userLoader.load(id); + if (user.contactNeopetsConnectionId == null) { + return null; + } + const neopetsConnection = await neopetsConnectionLoader.load( user.contactNeopetsConnectionId );