**System Information**
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2080 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.96
**Blender Version**
Broken: version: 3.3.0 Alpha, branch: master, commit date: 2022-05-25 21:21, hash: `rBdc6fe73e707f`
Worked: (newest version of Blender that worked as expected)
**Short description of error**
```
WARN (bpy.rna): C:\Users\blender\git\blender-vdev\blender.git\source\blender\python\intern\bpy_rna.c:1339 pyrna_enum_to_py: current value '3' matches no enum in 'SpaceProperties', '(null)', 'context'
```
when first time run the script below, it will get error`item.attr = val: enum "MATERIAL" not found in ()`
but when the property panel is exist (run the second time), it works.
It is an updata bug for the panel? How can I solve this problem or skip it?
**Exact steps for others to reproduce the error**
```
import bpy
area_props = bpy.context.window_manager.windows[-1].screen.areas[-1]
area_props.type = 'PROPERTIES'
print(area_props.spaces[0].context)
area_props.spaces[0].context = "MATERIAL"
```