Fix T65059: Crash in empty scenes for context _bases functions

Bug introduced on 0910932e71.
This commit is contained in:
Dalai Felinto 2019-05-24 09:49:40 -03:00
parent a875e81674
commit fae5896249
Notes: blender-bot 2023-05-22 12:40:41 +02:00
Referenced by issue #65059, Shift Ctrl Alt LMB / Ctrl Alt LMB in an empty scene closes / crashes Blender
1 changed files with 3 additions and 5 deletions

View File

@ -404,11 +404,9 @@ static int ctx_data_base_collection_get(const bContext *C, const char *member, L
ListBase ctx_object_list;
bool ok = false;
if (!ctx_data_collection_get(C, member, &ctx_object_list)) {
return 0;
}
if (BLI_listbase_is_empty(&ctx_object_list)) {
if ((ctx_data_collection_get(C, member, &ctx_object_list) == false) ||
BLI_listbase_is_empty(&ctx_object_list)) {
BLI_listbase_clear(list);
return 0;
}