title: TypeError: Cannot read property 'getRow' of null Google Script
body: <p>I am getting a TypeError when running this. I can't figure out why..</p>
  <pre><code>function iceHorsepowerInjector() {  
    let z = 0;
    let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('blah blah blah');
    let sheet1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('blah blah blah')
    let sheet2 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('blah blah blah')
    for (let i = 2; i &lt;= 1312; i++) { 
      let handle = sheet.getRange(&quot;A&quot;+[i]).getValue(); 
      if (handle == null){
        continue;
      } else {                                                     
      var index = sheet1.createTextFinder(handle).matchEntireCell(true).findNext().getRow(); // &lt;---- this is where I am getting the error
      }
      if (handle == null){
      continue;
      }
      index = parseInt(index);
      let horsepower = sheet1.getRange(&quot;EE&quot;+[index]).getValue();
      if (horsepower == &quot;NULL&quot;){
        continue;
      }                                            
      let id = sheet.getRange(&quot;CQ&quot;+[i]).getValue();
      if (id == &quot;#N/A&quot;){
        continue;
      }                                                        
        var commands = (&quot;UPDATE fossil_fuel_vehicle_trims SET horsepower&quot; + &quot;=&quot; + &quot;'&quot;+horsepower+ &quot;' WHERE id =&quot; + handle +&quot;;&quot;)
        sheet2.getRange(1+z,1).setValue(commands);   //set to last row used in sheet3
        z = z + 1
    }   
  }
  </code></pre>
  <p>This is the error..</p>
  <pre><code>    
  TypeError: Cannot read property 'getRow' of null
  iceHorsepowerInjector   @ Code.gs:11
  
  </code></pre>
  <p>How do I fix this? I feel as if I'm close but I can't seem to figure out why this is happening.</p>