From 019262cb51145d669ad50d94cfab27aaa3dcc463 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Wed, 29 Sep 2021 23:10:50 -0400 Subject: [PATCH] fix(plugins/sponsors): handle null tiers --- source/plugins/sponsors/index.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/plugins/sponsors/index.mjs b/source/plugins/sponsors/index.mjs index 2f467de0..8cb251e8 100644 --- a/source/plugins/sponsors/index.mjs +++ b/source/plugins/sponsors/index.mjs @@ -13,7 +13,7 @@ export default async function({login, q, imports, data, graphql, queries, accoun const {[account]:{sponsorsListing:{fullDescription, activeGoal}, sponsorshipsAsMaintainer:{nodes, totalCount:count}}} = await graphql(queries.sponsors({login, account})) const about = await imports.markdown(fullDescription, {mode:"multiline"}) const goal = activeGoal ? {progress:activeGoal.percentComplete, title:activeGoal.title, description:await imports.markdown(activeGoal.description)} : null - const list = nodes.map(({sponsorEntity:{login, avatarUrl}, tier:{monthlyPriceInDollars:amount}}) => ({login, avatarUrl, amount})) + const list = nodes.map(({sponsorEntity:{login, avatarUrl}, tier}) => ({login, avatarUrl, amount:tier?.monthlyPriceInDollars})) await Promise.all(list.map(async user => user.avatar = await imports.imgb64(user.avatarUrl))) //Results