Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

When removing a DOM element, ensure element exists before calling

methods on it.

Fixes #14
  • Loading branch information...
commit bf56c69b1d5cf2e7a42e8aa810943e8ddea5cf33 1 parent 61afe92
@jdhuntington jdhuntington authored jdhuntington committed
Showing with 2 additions and 1 deletion.
  1. +2 −1  tinycon.js
View
3  tinycon.js
@@ -59,7 +59,8 @@
var head = document.getElementsByTagName('head')[0];
for(var i=0, len=links.length; i < len; i++) {
- if (links[i].getAttribute('rel') === 'icon') {
+ var exists = (typeof(links[i]) !== 'undefined');
+ if (exists && links[i].getAttribute('rel') === 'icon') {
head.removeChild(links[i]);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.