[FIX] web_editor: properly save media dialog without any image

When saving the media dialog without any selected image, a crash
occurred. Now, it properly closes the dialog.

opw-1858614
This commit is contained in:
qsm-odoo
2018-06-14 10:47:38 +02:00
parent c4ddf55880
commit 50418c4811
+1 -2
View File
@@ -326,8 +326,7 @@ var ImageDialog = Widget.extend({
var img = this.images[0];
if (!img) {
var id = this.$(".existing-attachments [data-src]:first").data('id');
img = _.find(this.images, function (img) { return img.id === id;});
return this.media;
}
if (!img.is_document) {