Null in directory name does not return exception when it is created
<p>I just encountered a situation where a colleague is creating directories from a list.  It just so happens that one of the items in the list is null but an exception is not null. </p>

<p>To satisfy my curiosity, I wrote a test program to mimic what he was doing.  This test programo attempts to create a null directory in c:\Temp, which already exists.  I would've expected a Null Exception to be thrown but no exception was thrown.  </p>

<p>Here's my test program.</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace CreateNullDirectory
{
  class Program
  {
    static void Main(string[] args)
    {
        String DirectoryName = null;

        String FullDirectoryName = string.Format("c:\\Temp\\{0}",DirectoryName);

        Console.WriteLine(string.Format("Creating Directory {0}", FullDirectoryName));

        try
        {
            Directory.CreateDirectory(FullDirectoryName);
            Console.WriteLine(string.Format("Successfully created directory {0}", FullDirectoryName));
        }
        catch (Exception ex)
        {
            Console.WriteLine(string.Format("Error creating {0} - {1}", FullDirectoryName, ex.Message));
        }

        Console.ReadLine();

    }
  }
}
</code></pre>

<p>Here is the output:</p>

<p><img src="http://i.stack.imgur.com/3EBTz.jpg" alt="enter image description here"></p>

<p>Is CreateDirectory ignoring the terminating null and I'm only attempting to create C:\Temp which already exists?</p>
