I am using the Object Model and the Microsoft.SharePoint.Publishing.Fields.LinkFieldValue namespace in an attempt to set the value of a Hyperlink Column on a SharePoint 2007 Publishing Site.
However, if the field has no value prior to my update, I get System.ArgumentNullException when I attempt the assignment.
using Pub = Microsoft.SharePoint.Publishing;
int id = 1;
SPListItem item = SPContext.Current.List.GetItemById(itemId);
if(item.Fields.ContainsField("MyHyperlink"))
{
Pub.Fields.LinkFieldValue destination =
new Pub.Fields.LinkFieldValue("<a href=\"www.google.com\">Link</a>");
item["MyHyperlink"] = destination; //Null Exception here for item["MyHyperlink"]
item.SystemUpdate(true);
}