Prevent invalid mxc from getting used (#2609)

This commit is contained in:
Ajay Bura
2026-02-14 11:42:28 +05:30
committed by GitHub
parent 074c555294
commit 3522751a15
9 changed files with 24 additions and 15 deletions

View File

@@ -81,7 +81,8 @@ export const VideoContent = as<'div', VideoContentProps>(
const [srcState, loadSrc] = useAsyncCallback(
useCallback(async () => {
const mediaUrl = mxcUrlToHttp(mx, url, useAuthentication) ?? url;
const mediaUrl = mxcUrlToHttp(mx, url, useAuthentication);
if (!mediaUrl) throw new Error('Invalid media URL');
const fileContent = encInfo
? await downloadEncryptedMedia(mediaUrl, (encBuf) =>
decryptFile(encBuf, mimeType, encInfo)