**System Information**
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.19
**Blender Version**
Broken: Blender 2.82 Official.
**Short description of error**
Texture Paint returns an "//AttributeError: 'SpaceView3D' object has no attribute 'mode'//" error when painting on an object.
**Exact steps for others to reproduce the error**
I just tried Texture Paint (following this tutorial: https://youtu.be/u9nE2Xg6Jgk) and as soon as I started painting on my model, I got this error message:
1. I selected a cylinder
2. Then I activated the EDIT mode, Face
3. I selected all faces
4. Right-Click > UV Unwrap Faces > Smart UV Project (island margin: 0.0.3)
5. Then in the Texture Paint tab, I added a new texture (Base Color, 2048x2048)
6. Then I started to directly paint on the model and the error appeared.
```
Traceback (most recent call last):
File "D:\Sebastien\archived_softwares\0_blender\blender_official\2.82\scripts\startup\bl_operators\wm.py", line 1681, in execute
if fn(context, space_type, self.name, as_fallback=self.as_fallback):
File "D:\Sebastien\archived_softwares\0_blender\blender_official\2.82\scripts\startup\bl_ui\space_toolsystem_common.py", line 945, in activate_by_id
item, index = cls._tool_get_by_id(context, idname)
File "D:\Sebastien\archived_softwares\0_blender\blender_official\2.82\scripts\startup\bl_ui\space_toolsystem_common.py", line 265, in _tool_get_by_id
for item, index in ToolSelectPanelHelper._tools_flatten_with_tool_index(cls.tools_from_context(context)):
File "D:\Sebastien\archived_softwares\0_blender\blender_official\2.82\scripts\startup\bl_ui\space_toolsystem_common.py", line 230, in _tools_flatten_with_tool_index
for item in tools:
File "D:\Sebastien\archived_softwares\0_blender\blender_official\2.82\scripts\startup\bl_ui\space_toolsystem_toolbar.py", line 1725, in tools_from_context
mode = context.space_data.mode
AttributeError: 'SpaceView3D' object has no attribute 'mode'
location: <unknown location>:-1
```
PS : it just happened once. I am trying to reproduce the error, for the moment, without success.