I have a custom page that copies items from one list in one site to another, and its failing with the exception above.
I tried checking the field using sharepoint manager but I didnt find anything strange. The field where its failing its a managed metadata column the strange thing its that the exception is shown when checking if the field[internalname] is != null
foreach (SPListItem item in listItems)
{
SPListItem targetItem = destinationList.Items.Add();
foreach (SPField field in item.Fields)
{
if (!field.ReadOnlyField && field.InternalName !="Attachments")
{
if (item[field.InternalName] != null)
{
Update 1:
I tried these 2 ways and I still have the same error, its a managedmetadata field so no idea why its happeningn
//if (item.GetFormattedValue(field.InternalName) != null)
if (item[field.Id] != null)