diff options
author | Julian Eisel <julian@blender.org> | 2021-07-29 18:14:52 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-07-29 18:35:06 +0300 |
commit | 49c0b9ec438249e579485276c989aa16de5166ef (patch) | |
tree | 5c89f7795f82c86a65df4f8b61cb8181234c906b /source | |
parent | 5be54cce3692ae590433b786d8007767e3727469 (diff) |
Assets/UI: Sanity check argument for UILayout.template_asset_view()
Was already doing some sanity checks, but wasn't checking if the passed
property actually is a collection property, which is important.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_template_asset_view.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_template_asset_view.cc b/source/blender/editors/interface/interface_template_asset_view.cc index fe2c660f2d0..5c94881bdbf 100644 --- a/source/blender/editors/interface/interface_template_asset_view.cc +++ b/source/blender/editors/interface/interface_template_asset_view.cc @@ -162,6 +162,10 @@ static void asset_view_template_refresh_asset_collection( RNA_warning("Asset collection not found"); return; } + if (RNA_property_type(assets_prop) != PROP_COLLECTION) { + RNA_warning("Expected a collection property"); + return; + } if (!RNA_struct_is_a(RNA_property_pointer_type(&assets_dataptr, assets_prop), &RNA_AssetHandle)) { RNA_warning("Expected a collection property for AssetHandle items"); |