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:
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
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue