Fix T100118: Crash after Shift+D with nothing selected and then making new object

Regression from rB2d041fc46823, the "nothing to do, return" code path
was not re-enabling layer collection sync. Fixes T100118.
This commit is contained in:
Aras Pranckevicius 2022-08-02 09:28:17 +03:00
parent 2542fda14d
commit 02b1a209be
Notes: blender-bot 2023-02-13 14:48:23 +01:00
Referenced by commit ead8260a49, Object: move collection resync after empty duplicate early-out
Referenced by issue #100118, Regression: Crash after Shift+D with no selected items and then trying to make new object
1 changed files with 3 additions and 3 deletions

View File

@ -3715,13 +3715,13 @@ static int duplicate_exec(bContext *C, wmOperator *op)
}
}
CTX_DATA_END;
/* Sync the collection now, after everything is duplicated. */
BKE_layer_collection_resync_allow();
BKE_main_collection_sync(bmain);
if (source_bases_new_objects.is_empty()) {
return OPERATOR_CANCELLED;
}
/* Sync the collection now, after everything is duplicated. */
BKE_layer_collection_resync_allow();
BKE_main_collection_sync(bmain);
/* After sync we can get to the new Base data, process it here. */
for (const auto &item : source_bases_new_objects) {