I'm using c# .net 2.0 and need to check if the value returned from my method that I am assigning my object to is null.
My code is
MyObjectValue myObjectValue= (MyObjectValue) myObjectField.GetFieldValue();
In this instance the value returned by myObjectField.GetFieldValue() could be null and I want to check this before assigning to myObjectValue. At the moment it throws an exception object reference not set to a value of an object.
The actual line of code is using the SharePoint API
SPFieldUserValue lawyerResponsibleFieldValue =
(SPFieldUserValue)lawyerResponsibleUserField.GetFieldValue(
workflowProperties.Item[lawyerResponsibleUserField.Id].ToString());