title: specFlow error : ScenarioTearDown threw Object reference not set to an instance of an object excetion
body: <p>I am facing the issue in specflow scenario testing as follows.</p>
  
  <p>1.It is Throwing exception in Tear Down method as Object reference not set to an instance of the object.<br>
  2.Which is resulting in the test failure although test passes successfully.    </p>
  
  <p>plz help.</p>
  
  <p>Following is the feature.cs file  </p>
  
  <pre><code>// ------------------------------------------------------------------------------
  //  &lt;auto-generated&gt;
  //      This code was generated by SpecFlow (http://www.specflow.org/).
  //      SpecFlow Version:1.9.2.1
  //      SpecFlow Generator Version:1.9.0.0
  //      Runtime Version:4.0.30319.18052
  // 
  //      Changes to this file may cause incorrect behavior and will be lost if
  //      the code is regenerated.
  //  &lt;/auto-generated&gt;
  // ------------------------------------------------------------------------------
  #region Designer generated code
  #pragma warning disable
  namespace FunctionalTest.SpecFlowScenarios.APIKeyFixtures
  {
      using TechTalk.SpecFlow;
  
  
      [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.2.1")]
      [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
      [Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()]
      public partial class CreateAPIKeyFeature
      {
  
          private static TechTalk.SpecFlow.ITestRunner testRunner;
  
  #line 1 "CreateAPIKey.feature"
  #line hidden
  
          [Microsoft.VisualStudio.TestTools.UnitTesting.ClassInitializeAttribute()]
          public static void FeatureSetup(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext testContext)
          {
              testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
              TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "CreateAPIKey", "", ProgrammingLanguage.CSharp, ((string[])(null)));
              testRunner.OnFeatureStart(featureInfo);
          }
  
          [Microsoft.VisualStudio.TestTools.UnitTesting.ClassCleanupAttribute()]
          public static void FeatureTearDown()
          {
              testRunner.OnFeatureEnd();
              testRunner = null;
          }
  
          [Microsoft.VisualStudio.TestTools.UnitTesting.TestInitializeAttribute()]
          public virtual void TestInitialize()
          {
              if (((TechTalk.SpecFlow.FeatureContext.Current != null) 
                          &amp;&amp; (TechTalk.SpecFlow.FeatureContext.Current.FeatureInfo.Title != "CreateAPIKey")))
              {
                  Tavisca.Vexiere.FunctionalTest.SpecFlowScenarios.APIKeyFixtures.CreateAPIKeyFeature.FeatureSetup(null);
              }
          }
  
   // this method is throwing the null ref exception
         [Microsoft.VisualStudio.TestTools.UnitTesting.TestCleanupAttribute()]
          public virtual void ScenarioTearDown()
          {
              testRunner.OnScenarioEnd();
          }
  
          public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
          {
              testRunner.OnScenarioStart(scenarioInfo);
          }
  
          public virtual void ScenarioCleanup()
          {
              testRunner.CollectScenarioErrors();
          }
  
          [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
          [Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute("CreateAPIKey_Success")]
          [Microsoft.VisualStudio.TestTools.UnitTesting.TestPropertyAttribute("FeatureTitle", "CreateAPIKey")]
          [Microsoft.VisualStudio.TestTools.UnitTesting.TestCategoryAttribute("createAPIKey")]
          public virtual void CreateAPIKey_Success()
          {
              TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("CreateAPIKey_Success", new string[] {
                          "createAPIKey"});
  #line 5
  this.ScenarioSetup(scenarioInfo);
  #line 7
  testRunner.Given("that an Organization is already set up in Vexiere hierarchy.", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
  #line 8
  testRunner.When("I want to register new APIKey for above created organization.", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
  #line 9
  testRunner.Then("It should create new APIKey as per requested.", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
  #line hidden
              this.ScenarioCleanup();
          }
      }
  }
  #pragma warning restore
  #endregion
  </code></pre>