Core: Avoid null references that may be returned due to concurrent changes or inconsistent cluster state

Closes #7181