Last.fm: null checking

This commit is contained in:
amsyarasyiq 2023-02-16 16:11:09 +08:00
parent 2de73adffe
commit 49c083d536

View file

@ -75,6 +75,8 @@ function sendRequest(activity: Activity) {
/** Fetches a Discord application's asset */
async function fetchAsset<T extends string | string[]>(asset: T, appId: string = Constants.APPLICATION_ID): Promise<T> {
if (!asset) return null;
if (typeof asset === "string") {
const assetId = await AssetManager.getAssetIds(appId, [asset]);
return assetId[0] as T;