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.
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user