Fix T99301: RNA_boolean_get warning when saving a file for the first time

Caused by [0], RNA_struct_property_is_set also functioned to check if
the property existed.

[0]: 6a2c42a0d5
This commit is contained in:
Campbell Barton 2022-07-01 20:52:00 +10:00
parent 5e5fe217ca
commit b683a37824
Notes: blender-bot 2023-02-14 06:42:53 +01:00
Referenced by issue #99301, RNA_boolean_get warning when saving a file for the first time
1 changed files with 1 additions and 1 deletions

View File

@ -3063,7 +3063,7 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
char path[FILE_MAX];
const bool is_save_as = (op->type->invoke == wm_save_as_mainfile_invoke);
const bool use_save_as_copy = RNA_boolean_get(op->ptr, "copy");
const bool use_save_as_copy = is_save_as && RNA_boolean_get(op->ptr, "copy");
/* We could expose all options to the users however in most cases remapping
* existing relative paths is a good default.