Skip to content

Commit

Permalink
Update src/server-extension/resolvers/ChannelsResolver/index.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
  • Loading branch information
ignazio-bovo and zeeshanakram3 authored Aug 16, 2023
1 parent 9021d3e commit 14fdbc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server-extension/resolvers/ChannelsResolver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,11 @@ export class ChannelsResolver {

const ownerAccount = await getChannelOwnerAccount(em, channel)
if (ownerAccount) {
if (ctx.account === undefined) {
if (!ctx.account) {
// account not null because of the UseMiddleware(AccountOnly) decorator
throw new Error('Account not specified')
}
const followerAccount = ctx.account as Account
const followerAccount = ctx.account
const followerHandle =
(await em.getRepository(Membership).findOneByOrFail({ id: followerAccount.membershipId }))
?.handle || ''
Expand Down

0 comments on commit 14fdbc9

Please sign in to comment.