Ignore undefined icon name

issue7704
review51531002
This commit is contained in:
Cédric Krier committed 2018-09-19 00:11:38 +02:00
1 parent d81ea3e05a
commit eeb44911c6
1 file changed
+8 -3
+8 -3
View File
@@ -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('<img/>', 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;
},
});