title: Javascript Returning a Type Error "Unable to get property '1' of undefined or null reference"
body: <p>I can't for the life of me find out exactly what this error means in relation to my code.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
  &lt;link rel="stylesheet" href="../../styles.css" type="text/css"&gt;
  &lt;body bgcolor="#FFFFFF" text="#000000" link="#0033CC" vlink="#0033CC" alink="#0033CC"&gt;
  &lt;p&gt;&lt;font face="Arial, Helvetica, sans-serif"&gt;&lt;b&gt;&lt;font color="#000000"&gt;Job ref:&lt;/font&gt;&lt;/b&gt;&lt;font color="#000000"&gt;12345 &lt;br&gt;
  &lt;b&gt;Position:&lt;/b&gt; Position Title &lt;br&gt;
  &lt;b&gt;Organisation:&lt;/b&gt; Organisation Name &lt;br&gt;
  &lt;b&gt;Location: &lt;/b&gt; UK, England, London &lt;br&gt;
  &lt;b&gt;Closing date:&lt;/b&gt; 24/09/2015&lt;br&gt;
  &lt;b&gt;Job Type:&lt;/b&gt; Permanent &lt;br&gt;
  &lt;b&gt;Salary:&lt;/b&gt; £100,000 per annum &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;p&gt;&lt;font color="#000000" face="Arial, Helvetica, sans-serif"&gt;&lt;b&gt;Details:&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;
  &lt;p&gt;&lt;font color="#000000" face="Arial, Helvetica, sans-serif"&gt;This is a description&lt;/font&gt;&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>JAVASCRIPT</p>
  
  <pre><code>  DataExtractor.AddHeader(1, 'Country');
  
    var tmp = document.body.outerHTML.match(/Location: &lt;\/b&gt; ([^,]+), ([^,]+), ([^,]+)/i);
  
    var country = tmp[1] 
  
    if (country) {
    for (var i = 0; i &lt; country.length; i++) {
  
    DataExtractor.StartNewResult();
    DataExtractor.AddResult(1, country[i]);
     }
     }
  </code></pre>
  
  <p>When run it gives me the error as in the title.  Can anyone shed any light on what i'm missing?</p>
  
  <p>Thank you</p>