From 40204d6575b27540964bae177de923dd027e95cf Mon Sep 17 00:00:00 2001 From: "Achraf (abz)" Date: Tue, 4 May 2021 09:34:40 +0000 Subject: [PATCH] [FIX] mail: Allow to navigate quickly among the different attachments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What are the steps to reproduce your issue ? 1. Create a record and add two attachments 2. Navigate quickly between these attachments What is currently happening ? Traceback TypeError: Cannot read property 'complete' of undefined at AttachmentViewer._handleImageLoad (https://www.odoo.com/mail/static/src/components/attachment_viewer/attachment_viewer.js:163:20) opw-2521901 closes odoo/odoo#70334 X-original-commit: 2b3ad9bfa9459b8e39d769afa8fa61ceef925c75 Signed-off-by: Alexandre Kühn (aku) --- .../src/components/attachment_viewer/attachment_viewer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js index 60df28f4f29..bd2f3896c73 100644 --- a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js +++ b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js @@ -163,7 +163,7 @@ class AttachmentViewer extends Component { const image = refs[`image_${this.attachmentViewer.attachment.id}`]; if ( this.attachmentViewer.attachment.fileType === 'image' && - !image.complete + (!image || !image.complete) ) { this.attachmentViewer.update({ isImageLoading: true }); }