title: How to set Media Url of MediaPart? Orchard MediaLibraryPickerField MediaParts is null
body: <p>I am trying to automatically assign the MediaPart.MediaUrl to a custom image upon published. But..
  MediaPickerField MediaParts is always null. </p>
  
  <pre><code>        OnPublished&lt;BlogPostPart&gt;((context, part) =&gt;
          {
              ContentPart cp = part.ContentItem.Parts.Skip(13).First();
              MediaLibraryPickerField field = cp.Fields.FirstOrDefault() as MediaLibraryPickerField;
              if (field != null) { 
                 // this part throws an object null reference exception since fields.MediaParts is null
                 foreach(Orchard.MediaLibrary.Models.MediaPart mp in  field.MediaParts){
  
                 }
              }
          });
  </code></pre>
  
  <p>How to programically set the MediaUrl from the code on the event on publish? I am using Orchard 1.8</p>