From 7f837e492a3c2c25c5f34a6c52d4145caabd3b64 Mon Sep 17 00:00:00 2001 From: Lexie Date: Sat, 2 Nov 2024 17:30:44 +0100 Subject: [PATCH] handle nullish banner on member (#729) --- lib/src/models/guild/member.dart | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/src/models/guild/member.dart b/lib/src/models/guild/member.dart index b60147acf..05a2b081a 100644 --- a/lib/src/models/guild/member.dart +++ b/lib/src/models/guild/member.dart @@ -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].