Skip to content

Commit

Permalink
fix(matrix-client): add type check for fileUrl in downloadFile method (
Browse files Browse the repository at this point in the history
  • Loading branch information
domw30 authored Oct 2, 2024
1 parent 010c892 commit e9c95cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/chat/matrix-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ export class MatrixClient implements IChatClient {
// if the file is uploaded to the homerserver, then we need bearer token to download it
// since the endpoint to download the file is protected
async downloadFile(fileUrl: string) {
if (!fileUrl || !fileUrl.includes('_matrix/client/v1/media')) {
if (typeof fileUrl !== 'string' || !fileUrl || !fileUrl.includes('_matrix/client/v1/media')) {
return fileUrl;
}

Expand Down

0 comments on commit e9c95cb

Please sign in to comment.