Browse Source

Fix argument null exception on Message Create (#2045)

tags/3.2.0
Quin Lynch GitHub 3 years ago
parent
commit
a07531f655
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs

+ 3
- 3
src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs View File

@@ -1419,10 +1419,10 @@ namespace Discord.WebSocket
/// </returns>
public async ValueTask<SocketCustomSticker> GetStickerAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
{
var sticker = _stickers.FirstOrDefault(x => x.Key == id);
var sticker = _stickers?.FirstOrDefault(x => x.Key == id);

if (sticker.Value != null)
return sticker.Value;
if (sticker?.Value != null)
return sticker?.Value;

if (mode == CacheMode.CacheOnly)
return null;


Loading…
Cancel
Save