1

Closed

Null Reference Exception in WebTypeData.GetNamedDictionary(object p)

description

Inside the foreach loop the "value" variable needs a null check on it:
 
approx Line 200 of WebTypData.cs:
 
        foreach (KeyValuePair<string, GetValueDelegate> kvp in namedGetProperties)
        {
            object value = kvp.Value(p);
 
            if (value != null)
            {
                // ignore self-referencing values
                if (value.GetType() == p.GetType() && value is IComparable && (value as IComparable).CompareTo(p) == 0)
                {
                    continue;
                }
            }
 
            result.Properties[kvp.Key] = value;
        }
 
I was unable to transmit null values before making this change.
 
Cheers,
 
Jon.
Closed Mar 27, 2010 at 6:05 PM by mdekrey
Fixed in SVN.

comments

sqz wrote Feb 18, 2010 at 5:16 PM

Yes. I confirm this... I got an exception here while sending an object not conforming to the contract.

mdekrey wrote Mar 27, 2010 at 5:59 PM

Huh, I didn't realize that flash would send "null" - I thought it would leave it out.

I'll fix it in SVN now.

wrote Mar 27, 2010 at 6:05 PM

wrote Feb 14, 2013 at 1:08 AM

wrote May 16, 2013 at 4:20 AM