Closed
Description
When using the "group_by" option on the entity field type, it correctly groups choices together under an empty optgroup when the "group_by" property path doesn't exist (when an InvalidPropertyException is thrown).
However, when the property does exist on the entity, but the value is null, the PropertyPath class throws an UnexpectedTypeException, which isn't caught by the ObjectChoiceList class.
The UnexpectedTypeException seems to be the correct exception to be thrown (given the purpose of the PropertyPath class), so maybe this should be caught by the field type class?