js/ui: check whether a link tag has a type

The new favicon didn't have such, resulting in JS error when reloading
CSS at runtime.
This commit is contained in:
Thomas Gelf 2014-08-19 12:23:51 +02:00
parent 9ce99bf280
commit f40ada6c81
1 changed files with 1 additions and 1 deletions

View File

@ -100,7 +100,7 @@
icinga.logger.info('Reloading CSS'); icinga.logger.info('Reloading CSS');
$('link').each(function() { $('link').each(function() {
var $oldLink = $(this); var $oldLink = $(this);
if ($oldLink.attr('type').indexOf('css') > -1) { if ($oldLink.hasAttr('type') && $oldLink.attr('type').indexOf('css') > -1) {
var $newLink = $oldLink.clone().attr( var $newLink = $oldLink.clone().attr(
'href', 'href',
icinga.utils.addUrlParams( icinga.utils.addUrlParams(