Fix that will prevent the system to crash in some cases where the logged user is not linked to an entity