oops, fix crash when no neomail contact exists

This commit is contained in:
Emi Matchu 2020-10-24 00:11:56 -07:00
parent b28d8256b8
commit f832cb9acb

View file

@ -28,6 +28,10 @@ const resolvers = {
{ userLoader, neopetsConnectionLoader } { userLoader, neopetsConnectionLoader }
) => { ) => {
const user = await userLoader.load(id); const user = await userLoader.load(id);
if (user.contactNeopetsConnectionId == null) {
return null;
}
const neopetsConnection = await neopetsConnectionLoader.load( const neopetsConnection = await neopetsConnectionLoader.load(
user.contactNeopetsConnectionId user.contactNeopetsConnectionId
); );