From eeb44911c6087d68056aad008b3f7b48ded311ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 19 Sep 2018 00:11:38 +0200 Subject: [PATCH] Ignore undefined icon name issue7704 review51531002 --- src/common.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/common.js b/src/common.js index b9e7f5a697..0eadf861fd 100644 --- a/src/common.js +++ b/src/common.js @@ -2646,6 +2646,9 @@ return window.URL.createObjectURL(blob); }, get_icon_url: function(icon_name) { + if (!icon_name) { + return; + } return this.register_icon(icon_name).then(function() { if (icon_name in this.loaded_icons) { return this.loaded_icons[icon_name]; @@ -2665,9 +2668,11 @@ attrs['class'] = 'icon'; } var img = jQuery('', attrs); - this.get_icon_url(icon_name).then(function(url) { - img.attr('src', url); - }); + if (icon_name) { + this.get_icon_url(icon_name).then(function(url) { + img.attr('src', url); + }); + } return img; }, });