[Bf-blender-cvs] [967f763b5ca] asset-browser: Fix Python error print when no asset file is active
Julian Eisel
noreply at git.blender.org
Mon Nov 23 16:35:35 CET 2020
Commit: 967f763b5cab676911f887d3d194df50eca24ed1
Author: Julian Eisel
Date: Mon Nov 23 16:25:59 2020 +0100
Branches: asset-browser
https://developer.blender.org/rB967f763b5cab676911f887d3d194df50eca24ed1
Fix Python error print when no asset file is active
===================================================================
M release/scripts/modules/bpy_extras/asset_utils.py
===================================================================
diff --git a/release/scripts/modules/bpy_extras/asset_utils.py b/release/scripts/modules/bpy_extras/asset_utils.py
index ce18f29d812..db982e119d4 100644
--- a/release/scripts/modules/bpy_extras/asset_utils.py
+++ b/release/scripts/modules/bpy_extras/asset_utils.py
@@ -44,7 +44,7 @@ class SpaceAssetInfo:
def get_active_asset(cls, context: Context):
if hasattr(context, "active_file"):
active_file = context.active_file
- return active_file.asset_data
+ return active_file.asset_data if active_file else None
class AssetBrowserPanel:
bl_space_type = 'FILE_BROWSER'
More information about the Bf-blender-cvs
mailing list