When I try to create a CustomFieldsManager for some orders like this:
Code: Select all
CustomFieldsManager orderCustFieldMgr = new CustomFieldsManager(oneOrder);
Code: Select all
_tableName = AbleContext.Current.DatabaseFactory.Configuration
.GetClassMapping(_entity.GetType())
.RootTable
.Name;
For the orders that give the error, _entity.GetType() is returning {Name = "OrderProxy" FullName = "OrderProxy"}.
This causes AbleContext.Current.DatabaseFactory.Configuration.GetClassMapping() to return null, causing the NullReferenceException when it tries to access .RootTable.
Any idea why this is happening or how to fix it? The orders that exhibit this behavior are credit card orders that have been authorized, but not captured yet, if that helps.