From 49c083d536f96b988d6474cd938e1e7e6ba68b1f Mon Sep 17 00:00:00 2001 From: amsyarasyiq <82711525+amsyarasyiq@users.noreply.github.com> Date: Thu, 16 Feb 2023 16:11:09 +0800 Subject: [PATCH] Last.fm: null checking --- plugins/Last.fm/src/utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/Last.fm/src/utils.ts b/plugins/Last.fm/src/utils.ts index a296f5c..a134edd 100644 --- a/plugins/Last.fm/src/utils.ts +++ b/plugins/Last.fm/src/utils.ts @@ -75,6 +75,8 @@ function sendRequest(activity: Activity) { /** Fetches a Discord application's asset */ async function fetchAsset(asset: T, appId: string = Constants.APPLICATION_ID): Promise { + if (!asset) return null; + if (typeof asset === "string") { const assetId = await AssetManager.getAssetIds(appId, [asset]); return assetId[0] as T;