Try our conversational search powered by Generative AI!

PropertyDataCollection.TryGetValue<> cannot handle an empty value type properties

Vote:
 
When trying to get the value of a value type Property that is not set with TryGetValue<> I get a NullReferenceException. This since the property value returns null when empty and TryGetValue tries to cast the value to the given type. PropertyNumber, PropertyFloatNumber, PropertyBoolean, PropertyCategory, PropertyDateTime all behaves like this. Can you confirm that this is not the expected behavior of value type properties?
#15787
Sep 24, 2007 19:50
Vote:
 
This is most definitely a bug. It has been entered as 7386: PropertyDataCollection.TryGetValue<> cannot handle an empty value type properties. Thank you for the report!
#16370
Sep 27, 2007 12:26
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.