BS-6693: Avoid issues when an Environment is no more defined at
repository level but still in a process