bet you need to check this for `null` before doing the rest.  believe the attribute happily accepts a property name which doesn't exist in the type.