Return a rejected promise when registering an icon with no value

This makes the done callbacks to not be called so the src field of the image
is not set which is better than setting an empty value as the browser renders
it as a not found image when it can not found the image

issue5639
review29291002
This commit is contained in:
Sergi Almacellas Abellana committed 2016-06-15 09:53:50 +02:00
1 parent e8aff58546
commit 405c4e2954
1 file changed
+1 -1
+1 -1
View File
@@ -2468,7 +2468,7 @@
},
register_icon: function(icon_name) {
if (!icon_name) {
return jQuery.when('');
return jQuery.Deferred().reject();
} else if ((icon_name in this.loaded_icons) ||
~Sao.common.LOCAL_ICONS.indexOf(icon_name)) {
return jQuery.when(this.get_icon_url(icon_name));