Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-02-08 00:09:44 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-02-08 00:09:44 +0300
commit49745aa5ff63d054d36b3384ecb37835307e149c (patch)
tree8324e0d511f6d09220da8e961669ac8f1992af7a /source/blender
parent843271d0a5adec1059f91f7fd8854936a1228807 (diff)
Library linking code: proper early out in case there is nothing to link.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index dca1077ebc7..171863454d9 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -282,7 +282,6 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
char path[FILE_MAX_LIBEXTRA], root[FILE_MAXDIR], libname[FILE_MAX_LIBEXTRA], relname[FILE_MAX];
char *group, *name;
int totfiles = 0;
- short flag;
RNA_string_get(op->ptr, "filename", relname);
RNA_string_get(op->ptr, "directory", root);
@@ -319,7 +318,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- flag = wm_link_append_flag(op);
+ short flag = wm_link_append_flag(op);
/* sanity checks for flag */
if (scene && scene->id.lib) {
@@ -401,6 +400,12 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
BLI_BITMAP_ENABLE(item->libraries, 0);
}
+ if (lapp_data->num_items == 0) {
+ /* Early out in case there is nothing to link. */
+ wm_link_append_data_free(lapp_data);
+ return;
+ }
+
/* XXX We'd need re-entrant locking on Main for this to work... */
/* BKE_main_lock(bmain); */