Fix to ticket #13514: Law of Demeter when profile_id is None