If an object is hidden it is unsafe to look deep into its properties, such as evaluated mesh state. Do early visibility checks to avoid accessing possibly stake pointers. Pull Request: https://projects.blender.org/blender/blender/pulls/122496