Fix: Asset browser crash after recent cleanup

After 57586df687. Turns out the library can be null here.
This commit is contained in:
Hans Goudey
2024-02-14 17:41:17 -05:00
parent b9ed6ce0a5
commit c4d0e88e6e
@@ -181,11 +181,14 @@ class AssetCatalogTreeViewUnassignedItem : public ui::BasicTreeViewItem {
AssetCatalogTreeView::AssetCatalogTreeView(asset_system::AssetLibrary *library,
FileAssetSelectParams *params,
SpaceFile &space_file)
: asset_library_(library),
catalog_tree_(library->catalog_service->get_catalog_tree()),
params_(params),
space_file_(space_file)
: asset_library_(library), params_(params), space_file_(space_file)
{
if (library && library->catalog_service) {
catalog_tree_ = library->catalog_service->get_catalog_tree();
}
else {
catalog_tree_ = nullptr;
}
}
void AssetCatalogTreeView::build_tree()