fix: Do not crash when suspended in v9 (#1571)

This commit is contained in:
Stephen Mathieson 2021-07-06 21:03:32 -04:00 committed by GitHub
parent e3f6cf583b
commit b2694d575e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -54,6 +54,12 @@ export = async (app: Application): Promise<void> => {
let popular = await Promise.all(installations.map(async (installation) => {
const { account } = installation
// @ts-expect-error The `suspended_by` property does not exist in this version of the types.
if (installation.suspended_by?.login) {
app.log.warn({ installation }, 'Installation is suspended')
return account
}
if (ignoredAccounts.includes(account.login.toLowerCase())) {
account.stars = 0
app.log.debug({ installation }, 'Installation is ignored')