Fix argument null exception on Message Create (#2045)
This commit is contained in:
@@ -1419,10 +1419,10 @@ namespace Discord.WebSocket
|
|||||||
/// </returns>
|
/// </returns>
|
||||||
public async ValueTask<SocketCustomSticker> GetStickerAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
|
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)
|
if (sticker?.Value != null)
|
||||||
return sticker.Value;
|
return sticker?.Value;
|
||||||
|
|
||||||
if (mode == CacheMode.CacheOnly)
|
if (mode == CacheMode.CacheOnly)
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user