added null check

This commit is contained in:
irtiza-h30
2021-03-22 19:43:44 -04:00
parent 27d33b100e
commit 689046f41d

View File

@@ -522,15 +522,16 @@ const resolvers = {
return result && result.value2; return result && result.value2;
}, },
associatedSsidProfiles: ({ details }, args, { dataSources }) => { associatedSsidProfiles: ({ details }, args, { dataSources }) => {
const { associatedAccessSsidProfileIds } = details;
return ( return (
associatedAccessSsidProfileIds && details &&
dataSources.api.getProfilesById(associatedAccessSsidProfileIds) details.associatedAccessSsidProfileIds &&
dataSources.api.getProfilesById(details.associatedAccessSsidProfileIds)
); );
}, },
osuSsidProfile: ({ details }, args, { dataSources }) => { osuSsidProfile: ({ details }, args, { dataSources }) => {
const { osuSsidProfileId } = details; return (
return osuSsidProfileId && dataSources.api.getProfile(osuSsidProfileId); details && details.osuSsidProfileId && dataSources.api.getProfile(details.osuSsidProfileId)
);
}, },
}, },
ClientSession: { ClientSession: {