[Bf-extensions-cvs] [3302b5b2] master: BlenderKit: fix recent stability issue with context creation for asset bar

Vilém Duha noreply at git.blender.org
Sun Oct 11 16:36:10 CEST 2020


Commit: 3302b5b2dfae65408d6378163bc0a918b3e67ae4
Author: Vilém Duha
Date:   Mon Oct 5 14:11:44 2020 +0200
Branches: master
https://developer.blender.org/rBA3302b5b2dfae65408d6378163bc0a918b3e67ae4

BlenderKit: fix recent stability issue with context creation for asset bar

===================================================================

M	blenderkit/utils.py

===================================================================

diff --git a/blenderkit/utils.py b/blenderkit/utils.py
index 6b7ddd94..8ddd7e7d 100644
--- a/blenderkit/utils.py
+++ b/blenderkit/utils.py
@@ -654,7 +654,12 @@ def get_fake_context(context, area_type='VIEW_3D'):
     C_dict = {}  # context.copy() #context.copy was a source of problems - incompatibility with addons that also define context
     C_dict.update(region='WINDOW')
 
-    if context.area is None or context.area.type != area_type:
+    try:
+        context = context.copy()
+    except:
+        context = {}
+
+    if context.get('area') is None or context.get('area').type != area_type:
         w, a, r = get_largest_area(area_type=area_type)
 
         override = {'window': w, 'screen': w.screen, 'area': a, 'region': r}



More information about the Bf-extensions-cvs mailing list