title: Umbraco Document.getProperty(...).Value throws Null Reference Exception
body: <p>I am writing a small app that links into Umbraco (a small stand-alone console application that will eventually run as a scheduled task on the server) and I'm using the Umbraco APIs (4.5.2) to make changes to the database/document.</p>
  
  <p>Here is a fragment of what I'm doing:</p>
  
  <pre><code>IEnumerable&lt;Document&gt; documents = Document.GetChildrenForTree(parentDocumentId);
  foreach (Document doc in documents.Where(d =&gt; d.Published))
  {
      doc.getProperty("myData").Value = "some data"; // Exception here
      // ...other stuff here...
  }
  </code></pre>
  
  <p>However I always get a NullReferenceException because there are no properties. This confuses me because I can see that there are 5 properties in the umbraco interface.</p>
  
  <p>A colleague suggested that I use a Node instead of a document, however I can't even create one as I get a NullReferenceException from the Node class constructor.</p>
  
  <pre><code>Node myNode = new Node(-1); // NullReferenceException here
  </code></pre>
  
  <p>Does anyone have any ideas?</p>