Skip to content

Commit

Permalink
handle nullish banner on member (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lexedia authored Nov 2, 2024
1 parent dc4703c commit 7f837e4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lib/src/models/guild/member.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,16 @@ class Member extends PartialMember {
hash: avatarDecorationHash!,
);

CdnAsset get banner => CdnAsset(
client: manager.client,
base: HttpRoute()
..guilds(id: manager.guildId.toString())
..users(id: id.toString())
..banners(),
hash: bannerHash!,
);
CdnAsset? get banner => bannerHash == null
? null
: CdnAsset(
client: manager.client,
base: HttpRoute()
..guilds(id: manager.guildId.toString())
..users(id: id.toString())
..banners(),
hash: bannerHash!,
);
}

/// Flags that can be applied to a [Member].
Expand Down

0 comments on commit 7f837e4

Please sign in to comment.