1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / [SF 5.0] DynamicModuleManager.GetDataItem throws NullReferenceException with non existent Guid

[SF 5.0] DynamicModuleManager.GetDataItem throws NullReferenceException with non existent Guid

1 posts, 0 answered
  1. Yann
    Yann avatar
    19 posts
    Registered:
    24 Jun 2010
    13 Apr 2012
    Link to this post
    Code to reproduce it:

    Guid guid = Guid.Parse("{E048AF44-389C-4BA8-8508-443E7AC0C739}");
    var myType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.MyType.MyType");
    DynamicModuleManager manager = DynamicModuleManager.GetManager();
    var contentItem = manager.GetDataItem(myType , guid);

    As a consequence, calling DataService.SaveDataItem and providing a guid throws NullReferenceException instead of creating a new content item in the database.
1 posts, 0 answered