Fix T100850: Regression: Gpencil: crash on material color and other properties change.

rBcd49fee74114 forgot to add proper support for calls to `ntreeAddTree`
with a NULL Main (which should generate `NO_MAIN` ntrees).
This commit is contained in:
Bastien Montagne 2022-09-06 14:55:39 +02:00
parent 3dd9ab341a
commit 6f80c60ce6
Notes: blender-bot 2023-02-14 04:39:18 +01:00
Referenced by issue #100850, Regression: Gpencil: crash on material color and other properties change
1 changed files with 1 additions and 1 deletions

View File

@ -2569,7 +2569,7 @@ static bNodeTree *ntreeAddTree_do(
* node groups and other tree types are created as library data.
*/
int flag = 0;
if (is_embedded) {
if (is_embedded || bmain == nullptr) {
flag |= LIB_ID_CREATE_NO_MAIN;
}
bNodeTree *ntree = (bNodeTree *)BKE_libblock_alloc(bmain, ID_NT, name, flag);