[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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user