title: NullReferenceException when attempting to fire an event
body: <p>I'm learning about creating events and creating multi-threaded applications. </p>
  
  <p>The method <code>Thread</code> is called by another class which populates the params with search conditions. A <code>BackgroundWorker</code> is created, performs a search and returns the results to <code>worker_RunWorkerCompleted</code>. </p>
  
  <p>Within <code>worker_RunWorkerCompleted</code>, I want to send the results back to my UI which is subscribing to the <code>Fireendofsearch</code> event. </p>
  
  <p>I'm having trouble understanding why my code below throws the following error</p>
  
  <blockquote>
    <p>Object reference not set to an instance of an object.</p>
  </blockquote>
  
  <p>when I fire the event <code>Fireendofsearch</code></p>
  
  <pre><code>public class BackgroundSearch
  {
      public event SearchResultCompleteThreaded Fireendofsearch;
      public EventArgs a = null;
      public delegate void SearchResultCompleteThreaded(object seachresults, EventArgs a);
      internal void Thread(string folder, string parms)
      {
          var Argument = new List&lt;object&gt; { folder, parms };
          var worker = new BackgroundWorker {WorkerReportsProgress = false, WorkerSupportsCancellation = false};
          worker.DoWork += worker_DoWork;          
          worker.RunWorkerCompleted += worker_RunWorkerCompleted;
          worker.RunWorkerAsync(Argument);
      }
      void worker_DoWork(object sender, DoWorkEventArgs e)
      {
          var passedAugue = e.Argument as List&lt;object&gt;;
          var returnResult = new List&lt;string[]&gt;();
          if (passedAugue != null)
          {
              var result = Directory.GetFiles(passedAugue[0].ToString(), passedAugue[1].ToString(), SearchOption.AllDirectories);
              foreach (string s in result)
              {
                  var t = new string[4];
                  t[0] = s;
                  t[1] = File.GetCreationTime(s).ToString();
                  t[2] = File.GetLastAccessTime(s).ToString();
                  t[3] = File.GetLastWriteTime(s).ToString();
                  returnResult.Add(t);
              }
          }
          if (returnResult.Count != 0)
          {
              e.Result = returnResult;
          }            
      }
      void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
      {
          if (e.Result != null)
          {
              Fireendofsearch(e.Result, a);
          }
      }
  }
  </code></pre>