Fix #104992: Crash on calling operation search in outliner

After 7eda9d8dda, crash occurs when operation search is called and no
active tree element is present. Add missing null check in new poll
function to fix the crash.

Pull Request #105004
This commit is contained in:
Pratik Borhade 2023-02-25 18:36:24 +01:00
parent 01d4c8462d
commit f9bcd8c7e8

@ -3268,6 +3268,11 @@ static bool outliner_data_operation_poll(bContext *C)
}
const SpaceOutliner *space_outliner = CTX_wm_space_outliner(C);
const TreeElement *te = get_target_element(space_outliner);
if (te == nullptr) {
return false;
}
int scenelevel = 0, objectlevel = 0, idlevel = 0, datalevel = 0;
get_element_operation_type(te, &scenelevel, &objectlevel, &idlevel, &datalevel);
return ELEM(datalevel,