How to avoid javascript "rel" is null error? please have a look a on code provided
<p>I get this javascript error message </p>

<pre><code>Error: a.getAttribute("rel") is null
</code></pre>

<p>on these lines of code </p>

<pre><code>  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 &amp;&amp; a.getAttribute("title") &amp;&amp; !a.disabled) return a.getAttribute("title");
  }
  return null;
</code></pre>

<p>any ideas how do I sort it out?</p>

<p>Thanks.</p>
