Skip to content

Commit

Permalink
fix: Do not crash when suspended in v9 (#1571)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenmathieson committed Jul 7, 2021
1 parent e3f6cf5 commit b2694d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/apps/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit b2694d5

Please sign in to comment.