Handle bugs in neopets username data
Huh, looks like it's possible for a user's NeopetsConnection record to be missing, despite having the ID on their User record! Here, we handle that case.
This commit is contained in:
parent
8aa644a031
commit
94efb80e65
1 changed files with 4 additions and 0 deletions
|
@ -53,6 +53,10 @@ const resolvers = {
|
||||||
const neopetsConnection = await neopetsConnectionLoader.load(
|
const neopetsConnection = await neopetsConnectionLoader.load(
|
||||||
user.contactNeopetsConnectionId
|
user.contactNeopetsConnectionId
|
||||||
);
|
);
|
||||||
|
if (!neopetsConnection) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return neopetsConnection.neopetsUsername;
|
return neopetsConnection.neopetsUsername;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue