Outliner fix: prevent segfault when there is no active layer collection

This commit is contained in:
Dalai Felinto 2017-03-08 11:25:20 +01:00
parent 1345d29806
commit 04a391c2f8
1 changed files with 5 additions and 0 deletions

View File

@ -760,6 +760,11 @@ static eOLDrawState tree_element_active_collection(
if (set == OL_SETSEL_NONE) {
LayerCollection *active = CTX_data_layer_collection(C);
/* sometimes the renderlayer has no LayerCollection at all */
if (active == NULL) {
return OL_DRAWSEL_NONE;
}
if ((tselem->type == TSE_SCENE_COLLECTION && active->scene_collection == te->directdata) ||
(tselem->type == TSE_LAYER_COLLECTION && active == te->directdata))
{