title: Why cant I call this method again with same parameters? (null reference)
body: <p>I think I'm really missing something here, but can't figure out what. I want this method to return a web element, but if there is this specific error, I want it to try again:</p>
  
  <pre><code>int findCounter = 0;
  public IWebElement Find([Optional] string[] Element, [Optional] string Text)
  {
     IWebElement element;
  
     element = null;
  
     if (findCounter &lt; 30){
  
  
      if (Text != null)
      {
          Wait(null, Text);
          element = driver.FindElement(By.LinkText(Text));
          findCounter = 0;
          return element;
      }
  
  
      else
      {
          try
          {
              if (Element[1] == "xpath")
              {
                  Wait(Element, null);
                  element = driver.FindElement(By.XPath(Element[0]));
                  findCounter = 0;
  
              }
              else if (Element[1] == "id")
              {
                  Wait(Element, null);
                  element = driver.FindElement(By.Id(Element[0]));
                  findCounter = 0;
  
              }
              else if (Element[1] == "linktext")
              {
                  Wait(Element, null);
                  element = driver.FindElement(By.LinkText(Element[0]));
                  findCounter = 0;                   
              }
          }
          catch (StaleElementReferenceException e)
          {
              Console.Out.WriteLine("Attempting to recover from StaleElementReferenceException ...");
              Sleep(250);
              findCounter++;
              Find(Element, Text);
          }
          return element;
      }
      }   return null;
  }
  </code></pre>
  
  <p>So i try it: </p>
  
  <pre><code>Find(Element, null)
  </code></pre>
  
  <p>And it gets to error, outputs message, then fails:</p>
  
  <p>Attempting to recover from StaleElementReferenceException ...</p>
  
  <p>NullReferenceException 'Object reference not set to an instance of an object.'</p>
  
  <p>But i use same parameters as first time. What could be wrong ?</p>