title: EWS FindItemsResults<Item> Item.Move() does not move certain item types to a Mail folder such as IPM.Appointment
body: <p>I have some code that is moving items into a Mail Folder from the Deleted Items. The code works well and moves all the items generally. The problem occurs when it encounters an item that is not IPM.Note. It gives the error that is a null reference (See: <a href="https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it">What is a NullReferenceException, and how do I fix it?</a>)</p>
  
  <p>Which is odd as there are items there and it can't be null.</p>
  
  <p>Here is a code excerpt:</p>
  
  <pre><code>// Specify the Exchange Service
  ExchangeService E_SERVICE = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
  
  // Look at the root of the Mailbox (Top of Information Store)
  FolderId fldr_id = WellKnownFolderName.MsgFolderRoot;
  
  // Define the folder view
  FolderView newFV = new FolderView(1000);
  
  // Perform a deep traversal
  newFV.Traversal = FolderTraversal.Deep;
  
  // Get the results of all the folders in the Mailbox
  FindFoldersResults f_results = E_SERVICE.FindFolders(fldr_id, newFV);
  
  // Define the source and target folder id variables as null.
  FolderId src_fldr_id = null;
  FolderId tgt_fldr_id = null;
  
  // Define the folders we are looking to move items from the source to the target
  string source = "Deleted Items"
  string target = "Old Deleted Items"
  
  // Search through all the folders found in the mailbox
  foreach (Folder fldr in f_results)
  {
      // If the source folder name is the same as the current folder name then set the source folder ID
      if (fldr.DisplayName.ToLower() == source.ToLower())
      {
          src_fldr_id = fldr.Id;
      }
      // If the target folder name is the same as the current folder name then set the target folder ID
      if (fldr.DisplayName.ToLower() == target.ToLower())
      {
          tgt_fldr_id = fldr.Id;
      }
  }
  
  // Get all the items in the folder
  FindItemsResults&lt;Item&gt; findResults = E_SERVICE.FindItems(src_fldr_id, new ItemView(1000));
  
  // If the number of results does not equal 0
  if (findResults.TotalCount != 0)
  {
      // For each item in the folder move it to the target folder located earlier by ID.
      foreach(Item f_it in findResults)
      {
          f_it.Move(tgt_fldr_id);
      }
  }
  </code></pre>
  
  <p>We get the error thrown on the following line:</p>
  
  <pre><code>        f_it.Move(tgt_fldr_id);
  </code></pre>
  
  <p>This is as a Null Reference Exception which can't be the case as there are items there and it is usually an item that is not IPM.Note.</p>
  
  <p>So how would I go about getting around this and ensure the item gets moved regardless of what type it is?</p>
  
  <p>I have previously posted here about this <a href="https://stackoverflow.com/questions/42161157/unable-to-move-some-mail-items-using-ews-and-c-getting-an-error-of-null">Unable to move Mail items of different Item classes from the same folder using EWS</a></p>
  
  <p>Only to be shot down about it being a NullReferenceException when this is not the case!</p>
  
  <p>So any helpful answers would be greatly appreciated.</p>