From 326704a605226f94356fce12313a1d451f36212c Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 17 Jun 2024 11:37:07 +0530 Subject: [PATCH] tsc --- web/apps/cast/src/services/render.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/apps/cast/src/services/render.ts b/web/apps/cast/src/services/render.ts index e56ce1774f..d0a37323b6 100644 --- a/web/apps/cast/src/services/render.ts +++ b/web/apps/cast/src/services/render.ts @@ -7,6 +7,7 @@ import { nameAndExtension } from "@/next/file"; import log from "@/next/log"; import type { ComlinkWorker } from "@/next/worker/comlink-worker"; import { shuffled } from "@/utils/array"; +import { ensure } from "@/utils/ensure"; import { wait } from "@/utils/promise"; import ComlinkCryptoWorker from "@ente/shared/crypto"; import { ApiError } from "@ente/shared/error"; @@ -133,7 +134,7 @@ export const imageURLGenerator = async function* (castData: CastData) { // The last to last element is the one that was shown prior to that, // and now can be safely revoked. if (previousURLs.length > 1) - URL.revokeObjectURL(previousURLs.shift()); + URL.revokeObjectURL(ensure(previousURLs.shift())); previousURLs.push(url); @@ -254,7 +255,7 @@ const isFileEligible = (file: EnteFile) => { // extension. To detect the actual type, we need to sniff the MIME type, but // that requires downloading and decrypting the file first. const [, extension] = nameAndExtension(file.metadata.title); - if (isNonWebImageFileExtension(extension)) { + if (extension && isNonWebImageFileExtension(extension)) { // Of the known non-web types, we support HEIC. return isHEICExtension(extension); }