Fix regression: Crash garbage collecting VBOs on never evaluated scenes

Committing fix again, since it is somehow got lost when merging release
branch into master.
This commit is contained in:
Clément Foucault 2021-02-01 09:55:06 +01:00 committed by Sergey Sharybin
parent 356c62fe32
commit d19aaad0bc
1 changed files with 4 additions and 0 deletions

View File

@ -3457,6 +3457,10 @@ Depsgraph *BKE_scene_get_depsgraph(const Scene *scene, const ViewLayer *view_lay
{
BLI_assert(BKE_scene_has_view_layer(scene, view_layer));
if (scene->depsgraph_hash == NULL) {
return NULL;
}
DepsgraphKey key;
key.view_layer = view_layer;
return BLI_ghash_lookup(scene->depsgraph_hash, &key);