diff options
author | Julian Eisel <julian@blender.org> | 2022-06-14 18:03:27 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-06-14 18:07:40 +0300 |
commit | b690f4c2e6d02af522cebadb71318e14299dc362 (patch) | |
tree | f09fd94f7b95f40fdd5d64f0ced9b832f0dd7cf9 /source | |
parent | 06780aa4e6e04b10e1bf6be6850d6ad02f0c80af (diff) |
Fix T98875: Adding camera background image shows error
Don't show an error if no operator property is set at all that can be
used to find an image file or ID for dropping. The caller can decide if
this is an error that needs reporting or a valid case, like it is here.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index ac06ababfd4..60cded3b869 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -738,6 +738,7 @@ void WM_operator_last_properties_ensure(struct wmOperatorType *ot, struct Pointe wmOperator *WM_operator_last_redo(const struct bContext *C); /** * Use for drag & drop a path or name with operators invoke() function. + * Returns null if no operator property is set to identify the file or ID to use. */ ID *WM_operator_drop_load_path(struct bContext *C, struct wmOperator *op, short idcode); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 7b768bd8c70..9f21e952850 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1308,6 +1308,10 @@ ID *WM_operator_drop_load_path(struct bContext *C, wmOperator *op, const short i return id; } + if (!WM_operator_properties_id_lookup_is_set(op->ptr)) { + return NULL; + } + /* Lookup an already existing ID. */ id = WM_operator_properties_id_lookup_from_name_or_session_uuid(bmain, op->ptr, idcode); |