I have this piece of code :
try{
// other instructions
customer.Create(act.ID, act.AccountId.Value, act.AccountName, act.Referer);
// other instructions
}
catch (Exception ex)
{
Logging.Trace(ex);
}
In some cases, AccountId is null, and getting the Value like that threw an InvalidOperationException.
My question is : in a catch section, is this possible to retrieve the fact that AccountId was null ?
Using StackTrace or, something like that. I search on google but nothing appears. As much as possible, I do not want to modify the structure of the code before, using if( Account != null) etc...
Thanks in advance for any kind of help.