mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Merge pull request #6625 from matrix-org/palid/fix/media-isEncrypted-undefined
Fix error on accessing encrypted media without keys
This commit is contained in:
commit
1066bef1b0
1 changed files with 2 additions and 2 deletions
|
@ -178,7 +178,7 @@ export default class MFileBody extends React.Component<IProps, IState> {
|
|||
|
||||
private onPlaceholderClick = async () => {
|
||||
const mediaHelper = this.props.mediaEventHelper;
|
||||
if (mediaHelper.media.isEncrypted) {
|
||||
if (mediaHelper?.media.isEncrypted) {
|
||||
await this.decryptFile();
|
||||
this.downloadFile(this.fileName, this.linkText);
|
||||
} else {
|
||||
|
@ -192,7 +192,7 @@ export default class MFileBody extends React.Component<IProps, IState> {
|
|||
};
|
||||
|
||||
public render() {
|
||||
const isEncrypted = this.props.mediaEventHelper.media.isEncrypted;
|
||||
const isEncrypted = this.props.mediaEventHelper?.media.isEncrypted;
|
||||
const contentUrl = this.getContentUrl();
|
||||
const fileSize = this.content.info ? this.content.info.size : null;
|
||||
const fileType = this.content.info ? this.content.info.mimetype : "application/octet-stream";
|
||||
|
|
Loading…
Reference in a new issue