Non-nullable types get NullReferenceException when not set
description
If i use the following property in a PageTypePropertyGroup i will receive a NullReferenceException if the value is not set inside EPiServer
[PageTypeProperty(EditCaption="Sample date", SortOrder = 1)]
public virtual DateTime DateTime { get; set; }
I have checked out the code (GetPropertyGroupPropertyValue) and it seems like it is because the value is unconditionally cast to TProperty rather than to null check the underlying value and then return default(TProperty)
I guess the same applies for properties that is defined directly on the TypedPageType, but I have not confirmed it.