[SF 5.0] DynamicModuleManager.GetDataItem throws NullReferen

Posted by Community Admin on 04-Aug-2018 04:40

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

All Replies

Posted by Community Admin on 13-Apr-2012 00:00

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.

This thread is closed