title: Object reference not set to an instance of an object... but with interfaces. (C#)
body: <p>The following two lines of code are causing an error in my program because of a NullReferenceException.  </p>
  
  <pre><code>ISceneGraphFactory factory = null;
  IGroupNode Root = factory.CreateGroupNode("Root", "GroupNode", null);
  </code></pre>
  
  <p>Both of these are interfaces.  So basically I am trying to create that second interface IGroupNode with the factory.  (The error occurs on the second line).  Here is how the interfaces themselves look:</p>
  
  <pre><code>public interface ISceneGraphFactory
  {
      IDrawableNode CreateDrawableNode(string name, string DrawableType, object drawableData);
      IGroupNode CreateGroupNode(string name, string groupType, object groupData);
      IStateNode CreateStateNode(string name, string stateType, object stateData);
      ITransformNode CreateTransformNode(string name, string transformType, object transformData); 
  }
  
  public interface IGroupNode : ISceneNode, IEnumerable&lt;ISceneNode&gt;
  {
      void AddChild(ISceneNode child);
  }
  </code></pre>
  
  <p>They are both functioning and have worked in other programs.  </p>
  
  <p>Does anyone know how to get rid of this error when working with interfaces?  I think it is complaining because I am using interfaces here...</p>